MPBrowser.js
复制代码 代码如下:
var thisImgNo = 290;
function ajaxConn(){
var xmlhttp = false;
try{xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){try{xmlhttp = new XMLHttpRequest();}
catch(e){alert(e);xmlhttp = false;}}}
if(!xmlhttp)return null;
this.connect = function(Url,Method,postContent){
if(!xmlhttp)return false;
Method = Method.toUpperCase();
try{
if (Method == "GET"){
xmlhttp.open(Method,Url + '?' + postContent,true);
xmlhttp.setRequestHeader("Content-Type","text/html;charset=GB2312");
sVars = null;
}else{
xmlhttp.open(Method,Url,true);
xmlhttp.setRequestHeader("Method","POST "+Url+" HTTP/1.1");
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == 4){
if(xmlhttp.status == 200){
imgInfo = xmlhttp.ResponseText;
var imgInfoArr = imgInfo.split("|");
var tmpimg = new Image();
tmpimg.src = imgInfoArr[0];
thisImgNo = imgInfoArr[1];
var element = document.getElementById("img");
if(!element.xpos)element.xpos = 0;
element.style.width = (element.clientWidth + 130) + "px";
slideElement("img",element.xpos-130,0,10);
element.innerHTML += '<a href="http://blog.mzoe.com/" target="_blank"><img height="90" width="120" alt="" src="/UploadFiles/2021-04-02/'+imgInfoArr[0]+'"> }
}
}
xmlhttp.send(postContent);
}catch(z){return false;}
return true;
}
return this;
}
function loadImg(type){
var element = document.getElementById("img");
if(!element.xpos)element.xpos = 0;
if(type=="pre"){
if(element.xpos==0)return false;
slideElement("img",element.xpos+130,0,10);
}else{
if(element.xpos==-(element.clientWidth - 260)){
var myConn = new ajaxConn();
if(!myConn)return false;
myConn.connect("Cmd.asp","get","d="+thisImgNo);
}else{
slideElement("img",element.xpos-130,0,10);
}
}
}
function slideElement(elementId,x,y,inc){
var element = document.getElementById(elementId);
if(element.sliding)clearTimeout(element.sliding);
if(!element.xpos)element.xpos = 0;
if(!element.ypos)element.ypos = 0;
if(element.xpos == x && element.ypos == y) return true;
if(element.xpos > x){
var dist = Math.ceil((element.xpos-x)/inc);
element.xpos = element.xpos - dist;
}
if(element.xpos < x) {
var dist = Math.ceil((x-element.xpos)/inc);
element.xpos = element.xpos + dist;
}
if(element.ypos > y) {
var dist = Math.ceil((element.ypos-y)/inc);
element.ypos = element.ypos - dist;
}
if(element.ypos < y) {
var dist = Math.ceil((y-element.ypos)/inc);
element.ypos = element.ypos + dist;
}
element.style.left = element.xpos+'px';
element.style.top = element.ypos+'px';
element.sliding = setTimeout('slideElement("'+elementId+'",'+x+','+y+','+inc+')',10);
}
MPBrowser主要的特点是无刷新,简单易用,代码也相当的简单,只有几kb的js代码,可以与任何的后台轻易整合,最后不臭美的说还有点好看(当然换个样式也相当的方便)。
演示地址:http://www.mzoe.com/demo/MPBrowser/
下载地址:http://www.mzoe.com/downfile/MPBrowser_v1.rar
喜欢的朋友顶一下:D。
复制代码 代码如下:
var thisImgNo = 290;
function ajaxConn(){
var xmlhttp = false;
try{xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){try{xmlhttp = new XMLHttpRequest();}
catch(e){alert(e);xmlhttp = false;}}}
if(!xmlhttp)return null;
this.connect = function(Url,Method,postContent){
if(!xmlhttp)return false;
Method = Method.toUpperCase();
try{
if (Method == "GET"){
xmlhttp.open(Method,Url + '?' + postContent,true);
xmlhttp.setRequestHeader("Content-Type","text/html;charset=GB2312");
sVars = null;
}else{
xmlhttp.open(Method,Url,true);
xmlhttp.setRequestHeader("Method","POST "+Url+" HTTP/1.1");
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == 4){
if(xmlhttp.status == 200){
imgInfo = xmlhttp.ResponseText;
var imgInfoArr = imgInfo.split("|");
var tmpimg = new Image();
tmpimg.src = imgInfoArr[0];
thisImgNo = imgInfoArr[1];
var element = document.getElementById("img");
if(!element.xpos)element.xpos = 0;
element.style.width = (element.clientWidth + 130) + "px";
slideElement("img",element.xpos-130,0,10);
element.innerHTML += '<a href="http://blog.mzoe.com/" target="_blank"><img height="90" width="120" alt="" src="/UploadFiles/2021-04-02/'+imgInfoArr[0]+'"> }
}
}
xmlhttp.send(postContent);
}catch(z){return false;}
return true;
}
return this;
}
function loadImg(type){
var element = document.getElementById("img");
if(!element.xpos)element.xpos = 0;
if(type=="pre"){
if(element.xpos==0)return false;
slideElement("img",element.xpos+130,0,10);
}else{
if(element.xpos==-(element.clientWidth - 260)){
var myConn = new ajaxConn();
if(!myConn)return false;
myConn.connect("Cmd.asp","get","d="+thisImgNo);
}else{
slideElement("img",element.xpos-130,0,10);
}
}
}
function slideElement(elementId,x,y,inc){
var element = document.getElementById(elementId);
if(element.sliding)clearTimeout(element.sliding);
if(!element.xpos)element.xpos = 0;
if(!element.ypos)element.ypos = 0;
if(element.xpos == x && element.ypos == y) return true;
if(element.xpos > x){
var dist = Math.ceil((element.xpos-x)/inc);
element.xpos = element.xpos - dist;
}
if(element.xpos < x) {
var dist = Math.ceil((x-element.xpos)/inc);
element.xpos = element.xpos + dist;
}
if(element.ypos > y) {
var dist = Math.ceil((element.ypos-y)/inc);
element.ypos = element.ypos - dist;
}
if(element.ypos < y) {
var dist = Math.ceil((y-element.ypos)/inc);
element.ypos = element.ypos + dist;
}
element.style.left = element.xpos+'px';
element.style.top = element.ypos+'px';
element.sliding = setTimeout('slideElement("'+elementId+'",'+x+','+y+','+inc+')',10);
}
MPBrowser主要的特点是无刷新,简单易用,代码也相当的简单,只有几kb的js代码,可以与任何的后台轻易整合,最后不臭美的说还有点好看(当然换个样式也相当的方便)。
演示地址:http://www.mzoe.com/demo/MPBrowser/
下载地址:http://www.mzoe.com/downfile/MPBrowser_v1.rar
喜欢的朋友顶一下:D。
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“MPBrowser简易图片浏览器 v1.0”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。