- 浏览: 246763 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
seraph_fd:
已取用,谢谢。但将base64编码换成了Hex编码。
AES 加密 PHP 和 JAVA 互通 -
洋葱骑士:
调了一下OK了可是运行的时候,访问不了网站,出现域名错误
flexbuilder 和eclipse 整合 BlazeDs -
洋葱骑士:
出错了。。。。-无法将“<mx:RemoteObject ...
flexbuilder 和eclipse 整合 BlazeDs -
raxliao:
这个只支持16位的密钥,而且密码不能只能aes的随机码。不过测 ...
AES 加密 PHP 和 JAVA 互通 -
cnfnidt:
wwwwwwwwww
flex4 解析XML 例子
凤凰网图片集:
http://news.ifeng.com/photo/bigpicture/519_slide.shtml
附件tpj.rar为实现:
数据js--photojsondata.js:
var photojsondata={'title':'山东馆形如海岱交融 演绎齐鲁青未了','summary':'','pubdate':'2010-03-24 15:54:16','contents':[{'title':'外观效','summary':'山东馆外观效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417299141_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417299141_596.jpg','orderid':2},{'title':'鲁班锁','summary':'山东馆鲁班锁效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417300516_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417300516_596.jpg','orderid':3},{'title':'城市窗口','summary':'山东馆“城市窗口”效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417307344_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417307344_596.jpg','orderid':4},{'title':'名人','summary':'山东馆序厅“智慧长廊”中“名人”展区效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417302828_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417302828_596.jpg','orderid':5},{'title':'智慧长廊','summary':'山东馆序厅“智慧长廊”中“名物”展区效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417296578_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417296578_596.jpg','orderid':6}]};
功能代码--SlideHelper.js摘自凤凰网并根据需要改动:
SlideHelper.js
var SlideHelper = {
"albumTitle":null,
"albumSummary":null,
"albumPubdate":null,
"ImgBox":null,
"ImgObj":null,
"ThumbBox":null,
"MemoBox":null,
"CurNumBox":null,
"TotalNumBox":null,
"PreBtn":null,
"NextBtn":null,
"PrePageBtn":null,
"NextPageBtn":null,
"Data":[],
"NextLink":'',
"ThumbExt":'thumb_170x114_',
"CurrentIndex":0,
"CurrentPage":-1,
"CurrentThumb":null,
"ThumbViewCount":5,
"ShowTimeoutId":null,
"PreDocUrl":'',
"Init":function(imgjson__)
{
SlideHelper.Data = imgjson__.contents;
SlideHelper.TotalNumBox.innerHTML = SlideHelper.Data.length;
if(SlideHelper.PreBtn) SlideHelper.PreBtn.onclick = SlideHelper.Pre;
if(SlideHelper.NextBtn) SlideHelper.NextBtn.onclick = SlideHelper.Next;
if(SlideHelper.albumTitle) SlideHelper.albumTitle.innerHTML=imgjson__.title;
if(SlideHelper.albumSummary) SlideHelper.albumSummary.innerHTML=imgjson__.summary;
if(SlideHelper.albumPubdate) SlideHelper.albumPubdate.innerHTML=imgjson__.pubdate;
if(SlideHelper.PrePageBtn) SlideHelper.PrePageBtn.onclick = SlideHelper.PrePage;
if(SlideHelper.NextPageBtn) SlideHelper.NextPageBtn.onclick = SlideHelper.NextPage;
var curIndex = GetArgsFromHref(window.location.href,"index");
if(curIndex=='')
{
curIndex = 0;
}
SlideHelper.PreDocUrl = decodeURIComponent(GetArgsFromHref(window.location.href,"pre"));
SlideHelper.CurrentIndex = parseInt(curIndex);
SlideHelper.RenderImg();
},
"RenderImg":function()
{
if(SlideHelper.CurrentIndex<SlideHelper.Data.length)
{
var item = SlideHelper.Data[SlideHelper.CurrentIndex];
if(SlideHelper.ImgObj==null)
{
SlideHelper.ImgBox.innerHTML = '<img id="bigImage" style="filter: revealTrans(Duration=4.0, Transition=23);" onmousemove="SlideHelper.imageonmousemove(event)" onclick="SlideHelper.imageonclick(event);" onload="SlideHelper.ChangeImg();" src="'+ item.img_b +'" />';
SlideHelper.ImgObj = $('bigImage');
}
else
{
SlideHelper.ImgObj.style.visibility ="hidden";
SlideHelper.ShowTimeoutId = setTimeout("SlideHelper.ShowImg()",1500);//确保图片在没有执行onload情况下也能显示
SlideHelper.ImgObj.src = item.img_b;
}
var ext='';
if(item.targetlink!="")
ext = '';
SlideHelper.MemoBox.innerHTML=item.summary + ext;
//SlideHelper.CurNumBox.innerHTML = SlideHelper.CurrentIndex+1; 当前第几页
if(SlideHelper.NextBtn){
if(SlideHelper.CurrentIndex==SlideHelper.Data.length-1)
{
SlideHelper.NextBtn.onclick = function()
{
if(SlideHelper.NextLink!='')
window.location.href = SlideHelper.NextLink ;
};
}
}
if(SlideHelper.PreBtn){
if(SlideHelper.CurrentIndex==0)
SlideHelper.PreBtn.style.display="none";
else
SlideHelper.PreBtn.style.display="";
}
//设置小图
SlideHelper.SetThumb();
}
},
"SetCurrent":function()
{
var params = window.location.href.split("?");
window.location.href=params[0] + "?index=" + SlideHelper.CurrentIndex + "&pre=" + encodeURIComponent(SlideHelper.PreDocUrl);
},
"Set":function(index)
{
SlideHelper.CurrentIndex = index;
SlideHelper.SetCurrent();
},
"Pre":function()
{
if(SlideHelper.CurrentIndex>0)
{
SlideHelper.CurrentIndex--;
SlideHelper.SetCurrent();
}
},
"Next":function()
{
if(SlideHelper.CurrentIndex<SlideHelper.Data.length-1)
{
SlideHelper.CurrentIndex++;
SlideHelper.SetCurrent();
}
},
"SetThumb":function()
{
var curpage = Math.floor(SlideHelper.CurrentIndex/SlideHelper.ThumbViewCount);
if(SlideHelper.CurrentPage==curpage){
//if(SlideHelper.CurrentThumb)
// SlideHelper.CurrentThumb.className = '';
SlideHelper.ClearCurrent();
$('thumb_li_' + SlideHelper.CurrentIndex).className ="cur";
}
else
{
SlideHelper.SetPage(curpage);
SlideHelper.CurrentPage=curpage;
}
//SlideHelper.CurrentThumb = $('thumb_li_' + SlideHelper.CurrentIndex);
},
"PrePage":function()
{
if(SlideHelper.CurrentPage>0)
{
SlideHelper.CurrentPage--;
SlideHelper.SetPage(SlideHelper.CurrentPage);
}
},
"NextPage":function()
{
if(SlideHelper.CurrentPage<Math.floor((SlideHelper.Data.length-1)/SlideHelper.ThumbViewCount))
{
SlideHelper.CurrentPage++;
SlideHelper.SetPage(SlideHelper.CurrentPage);
}
},
"SetPage":function(curpage)
{
var s=''
var startIndex = curpage*SlideHelper.ThumbViewCount;
var endIndex = (curpage+1)*SlideHelper.ThumbViewCount;
endIndex = endIndex<SlideHelper.Data.length-1?endIndex:SlideHelper.Data.length-1;
for(var i=startIndex;i<=endIndex;i++)
{
var curExt = '';
if(i==SlideHelper.CurrentIndex)
curExt=' class="cur" ';
var thumburl =SlideHelper.Data[i].img_s;
s+='<li id="thumb_li_'+ i +'" '+ curExt +'><a href="javascript:SlideHelper.Set('+ i +');"><img src="'+ thumburl +'" /></a></li>';
}
SlideHelper.ThumbBox.innerHTML = s;
},
"_GetThumbUrl":function(bigimgurl)
{
var pos = bigimgurl.lastIndexOf("/");
var thumburl = bigimgurl.substring(0,pos+1) + SlideHelper.ThumbExt + bigimgurl.substring(pos+1);
return thumburl;
},
"ShowImg":function()
{
SlideHelper.ImgObj.style.visibility="visible";
SlideHelper.ShowTimeoutId=null;
},
"ClearCurrent":function()
{
var lis = SlideHelper.ThumbBox.getElementsByTagName("li");
for(var i=0;i<lis.length;i++)
{
lis[i].className = "";
}
},
"imageonmousemove":function(evnt)
{
var photopos = SlideHelper.getpos(SlideHelper.ImgObj);
var obj = SlideHelper.ImgObj;
if (evnt)
{
//nx = (parseInt(evnt.clientX)-photopos2.left) / $("bigImage").width;
nx = (parseInt(evnt.clientX)-photopos.left) / SlideHelper.ImgObj.width;
if((nx>=0.5))
{
obj.style.cursor = "url("+"./images/right.cur"+"),auto";
if(SlideHelper.CurrentIndex==SlideHelper.Data.length-1 && SlideHelper.NextLink!='')
obj.title = "点击浏览下一组>>";
else
obj.title = "点击浏览下一张>>";
}
if ( nx<0.5)
{
obj.style.cursor = "url("+"./images/left.cur"+"),auto";
obj.title = "<<点击浏览上一张";
}
}
},
"imageonclick":function(evnt)
{
var photopos = SlideHelper.getpos(SlideHelper.ImgObj);
var obj = SlideHelper.ImgObj;
if (evnt)
{
nx = (parseInt(evnt.clientX)-photopos.left) / SlideHelper.ImgObj.width;
if(nx>=0.5)
{
if(SlideHelper.CurrentIndex==SlideHelper.Data.length-1)
{
var preurl = window.location.href.split("?")[0];
if(GetArgsFromHref(window.location.href,"index")!="")
preurl += "?index=" + GetArgsFromHref(window.location.href,"index");
window.location.href = SlideHelper.NextLink + "?index=0&pre=" + encodeURIComponent(preurl);
}
else
SlideHelper.Next();
}
else if (SlideHelper.CurrentIndex>0 && nx<0.5)
{
SlideHelper.Pre();
}
else if(SlideHelper.CurrentIndex==0)
{
if(SlideHelper.PreDocUrl!='')
{
window.location.href = SlideHelper.PreDocUrl;
}
}
}
},
"getpos":function(element)
{
if ( arguments.length != 1 || element == null )
{
return null;
}
var elmt = element;
var offsetTop = elmt.offsetTop;
var offsetLeft = elmt.offsetLeft;
var offsetWidth = elmt.offsetWidth;
var offsetHeight = elmt.offsetHeight;
while( elmt = elmt.offsetParent )
{
if ( elmt.style.position == 'absolute'
// || elmt.style.position == 'relative'
|| ( elmt.style.overflow != 'visible' && elmt.style.overflow != '' ) )
{
break;
}
offsetTop += elmt.offsetTop;
offsetLeft += elmt.offsetLeft;
}
return {top:offsetTop, left:offsetLeft, right:offsetWidth+offsetLeft, bottom:offsetHeight+offsetTop };
},
/*
切换图片时图片幻灯展示的效果
*/
"ChangeImg":function()
{
if(SlideHelper.ShowTimeoutId)
{
clearTimeout(SlideHelper.ShowTimeoutId);
var transition = 12;//图片切换时渐变方式 1--23
var tranSpeed = 0.5;//图片切换渐变速度。 值越小速度越快
var oImg = SlideHelper.ImgObj;
if(!oImg) return;
if (document.all){
oImg.filters.revealTrans.apply();
}
if (document.all)
{
if(!this.tranRandom) oImg.filters.revealTrans.transition = transition;
oImg.style.visibility = "visible";
oImg.style.display ="";
oImg.filters.revealTrans.play(tranSpeed);
}
else
{
oImg.style.visibility = "visible";
}
}
}
};
/*
*函数功能:从href获得参数
*sArgName:arg1, arg2
*return: the value of arg. d, re
*/
function GetArgsFromHref(sHref, sArgName)
{
var args = sHref.split("?");
var retval = "";
if(args[0] == sHref) /*参数为空*/
{
return retval; /*无需做任何处理*/
}
var str = args[1];
args = str.split("&");
for(var i = 0; i < args.length; i ++)
{
str = args[i];
var arg = str.split("=");
if(arg.length <= 1) continue;
if(arg[0] == sArgName) retval = arg[1];
}
return retval;
}
function $(el)
{
if(!el)
{
return null;
}
else if(typeof el=='string')
{
return document.getElementById(el);
}
else if(typeof el=='object')
{
return el;
}
}
window.onload = function()
{
SlideHelper.ImgBox=$('tpj2_img');
SlideHelper.ThumbBox=$('thumbimg');
SlideHelper.CurNumBox=$('curImgNumBox');
SlideHelper.TotalNumBox=$('TotalImgNumBox');
SlideHelper.MemoBox =$('imgMemoBox');
//SlideHelper.PreBtn =$('pre1');
//SlideHelper.NextBtn =$('next1');
SlideHelper.PrePageBtn =$('tpj_pre');
SlideHelper.NextPageBtn =$('tpj_next');
SlideHelper.albumTitle =$('albumTitle');
SlideHelper.albumSummary =$('albumSummary');
SlideHelper.albumPubdate =$('albumPubdate');
SlideHelper.NextLink = '';
SlideHelper.Init(photojsondata);
}
http://news.ifeng.com/photo/bigpicture/519_slide.shtml
附件tpj.rar为实现:
数据js--photojsondata.js:
var photojsondata={'title':'山东馆形如海岱交融 演绎齐鲁青未了','summary':'','pubdate':'2010-03-24 15:54:16','contents':[{'title':'外观效','summary':'山东馆外观效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417299141_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417299141_596.jpg','orderid':2},{'title':'鲁班锁','summary':'山东馆鲁班锁效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417300516_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417300516_596.jpg','orderid':3},{'title':'城市窗口','summary':'山东馆“城市窗口”效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417307344_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417307344_596.jpg','orderid':4},{'title':'名人','summary':'山东馆序厅“智慧长廊”中“名人”展区效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417302828_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417302828_596.jpg','orderid':5},{'title':'智慧长廊','summary':'山东馆序厅“智慧长廊”中“名物”展区效果图','img_b':'http://pic.vodone.com/news/images/2010/3/24/20103241269417296578_596.jpg','img_s':'http://pic.vodone.com/news/images/2010/3/24/20103241269417296578_596.jpg','orderid':6}]};
功能代码--SlideHelper.js摘自凤凰网并根据需要改动:
SlideHelper.js
var SlideHelper = {
"albumTitle":null,
"albumSummary":null,
"albumPubdate":null,
"ImgBox":null,
"ImgObj":null,
"ThumbBox":null,
"MemoBox":null,
"CurNumBox":null,
"TotalNumBox":null,
"PreBtn":null,
"NextBtn":null,
"PrePageBtn":null,
"NextPageBtn":null,
"Data":[],
"NextLink":'',
"ThumbExt":'thumb_170x114_',
"CurrentIndex":0,
"CurrentPage":-1,
"CurrentThumb":null,
"ThumbViewCount":5,
"ShowTimeoutId":null,
"PreDocUrl":'',
"Init":function(imgjson__)
{
SlideHelper.Data = imgjson__.contents;
SlideHelper.TotalNumBox.innerHTML = SlideHelper.Data.length;
if(SlideHelper.PreBtn) SlideHelper.PreBtn.onclick = SlideHelper.Pre;
if(SlideHelper.NextBtn) SlideHelper.NextBtn.onclick = SlideHelper.Next;
if(SlideHelper.albumTitle) SlideHelper.albumTitle.innerHTML=imgjson__.title;
if(SlideHelper.albumSummary) SlideHelper.albumSummary.innerHTML=imgjson__.summary;
if(SlideHelper.albumPubdate) SlideHelper.albumPubdate.innerHTML=imgjson__.pubdate;
if(SlideHelper.PrePageBtn) SlideHelper.PrePageBtn.onclick = SlideHelper.PrePage;
if(SlideHelper.NextPageBtn) SlideHelper.NextPageBtn.onclick = SlideHelper.NextPage;
var curIndex = GetArgsFromHref(window.location.href,"index");
if(curIndex=='')
{
curIndex = 0;
}
SlideHelper.PreDocUrl = decodeURIComponent(GetArgsFromHref(window.location.href,"pre"));
SlideHelper.CurrentIndex = parseInt(curIndex);
SlideHelper.RenderImg();
},
"RenderImg":function()
{
if(SlideHelper.CurrentIndex<SlideHelper.Data.length)
{
var item = SlideHelper.Data[SlideHelper.CurrentIndex];
if(SlideHelper.ImgObj==null)
{
SlideHelper.ImgBox.innerHTML = '<img id="bigImage" style="filter: revealTrans(Duration=4.0, Transition=23);" onmousemove="SlideHelper.imageonmousemove(event)" onclick="SlideHelper.imageonclick(event);" onload="SlideHelper.ChangeImg();" src="'+ item.img_b +'" />';
SlideHelper.ImgObj = $('bigImage');
}
else
{
SlideHelper.ImgObj.style.visibility ="hidden";
SlideHelper.ShowTimeoutId = setTimeout("SlideHelper.ShowImg()",1500);//确保图片在没有执行onload情况下也能显示
SlideHelper.ImgObj.src = item.img_b;
}
var ext='';
if(item.targetlink!="")
ext = '';
SlideHelper.MemoBox.innerHTML=item.summary + ext;
//SlideHelper.CurNumBox.innerHTML = SlideHelper.CurrentIndex+1; 当前第几页
if(SlideHelper.NextBtn){
if(SlideHelper.CurrentIndex==SlideHelper.Data.length-1)
{
SlideHelper.NextBtn.onclick = function()
{
if(SlideHelper.NextLink!='')
window.location.href = SlideHelper.NextLink ;
};
}
}
if(SlideHelper.PreBtn){
if(SlideHelper.CurrentIndex==0)
SlideHelper.PreBtn.style.display="none";
else
SlideHelper.PreBtn.style.display="";
}
//设置小图
SlideHelper.SetThumb();
}
},
"SetCurrent":function()
{
var params = window.location.href.split("?");
window.location.href=params[0] + "?index=" + SlideHelper.CurrentIndex + "&pre=" + encodeURIComponent(SlideHelper.PreDocUrl);
},
"Set":function(index)
{
SlideHelper.CurrentIndex = index;
SlideHelper.SetCurrent();
},
"Pre":function()
{
if(SlideHelper.CurrentIndex>0)
{
SlideHelper.CurrentIndex--;
SlideHelper.SetCurrent();
}
},
"Next":function()
{
if(SlideHelper.CurrentIndex<SlideHelper.Data.length-1)
{
SlideHelper.CurrentIndex++;
SlideHelper.SetCurrent();
}
},
"SetThumb":function()
{
var curpage = Math.floor(SlideHelper.CurrentIndex/SlideHelper.ThumbViewCount);
if(SlideHelper.CurrentPage==curpage){
//if(SlideHelper.CurrentThumb)
// SlideHelper.CurrentThumb.className = '';
SlideHelper.ClearCurrent();
$('thumb_li_' + SlideHelper.CurrentIndex).className ="cur";
}
else
{
SlideHelper.SetPage(curpage);
SlideHelper.CurrentPage=curpage;
}
//SlideHelper.CurrentThumb = $('thumb_li_' + SlideHelper.CurrentIndex);
},
"PrePage":function()
{
if(SlideHelper.CurrentPage>0)
{
SlideHelper.CurrentPage--;
SlideHelper.SetPage(SlideHelper.CurrentPage);
}
},
"NextPage":function()
{
if(SlideHelper.CurrentPage<Math.floor((SlideHelper.Data.length-1)/SlideHelper.ThumbViewCount))
{
SlideHelper.CurrentPage++;
SlideHelper.SetPage(SlideHelper.CurrentPage);
}
},
"SetPage":function(curpage)
{
var s=''
var startIndex = curpage*SlideHelper.ThumbViewCount;
var endIndex = (curpage+1)*SlideHelper.ThumbViewCount;
endIndex = endIndex<SlideHelper.Data.length-1?endIndex:SlideHelper.Data.length-1;
for(var i=startIndex;i<=endIndex;i++)
{
var curExt = '';
if(i==SlideHelper.CurrentIndex)
curExt=' class="cur" ';
var thumburl =SlideHelper.Data[i].img_s;
s+='<li id="thumb_li_'+ i +'" '+ curExt +'><a href="javascript:SlideHelper.Set('+ i +');"><img src="'+ thumburl +'" /></a></li>';
}
SlideHelper.ThumbBox.innerHTML = s;
},
"_GetThumbUrl":function(bigimgurl)
{
var pos = bigimgurl.lastIndexOf("/");
var thumburl = bigimgurl.substring(0,pos+1) + SlideHelper.ThumbExt + bigimgurl.substring(pos+1);
return thumburl;
},
"ShowImg":function()
{
SlideHelper.ImgObj.style.visibility="visible";
SlideHelper.ShowTimeoutId=null;
},
"ClearCurrent":function()
{
var lis = SlideHelper.ThumbBox.getElementsByTagName("li");
for(var i=0;i<lis.length;i++)
{
lis[i].className = "";
}
},
"imageonmousemove":function(evnt)
{
var photopos = SlideHelper.getpos(SlideHelper.ImgObj);
var obj = SlideHelper.ImgObj;
if (evnt)
{
//nx = (parseInt(evnt.clientX)-photopos2.left) / $("bigImage").width;
nx = (parseInt(evnt.clientX)-photopos.left) / SlideHelper.ImgObj.width;
if((nx>=0.5))
{
obj.style.cursor = "url("+"./images/right.cur"+"),auto";
if(SlideHelper.CurrentIndex==SlideHelper.Data.length-1 && SlideHelper.NextLink!='')
obj.title = "点击浏览下一组>>";
else
obj.title = "点击浏览下一张>>";
}
if ( nx<0.5)
{
obj.style.cursor = "url("+"./images/left.cur"+"),auto";
obj.title = "<<点击浏览上一张";
}
}
},
"imageonclick":function(evnt)
{
var photopos = SlideHelper.getpos(SlideHelper.ImgObj);
var obj = SlideHelper.ImgObj;
if (evnt)
{
nx = (parseInt(evnt.clientX)-photopos.left) / SlideHelper.ImgObj.width;
if(nx>=0.5)
{
if(SlideHelper.CurrentIndex==SlideHelper.Data.length-1)
{
var preurl = window.location.href.split("?")[0];
if(GetArgsFromHref(window.location.href,"index")!="")
preurl += "?index=" + GetArgsFromHref(window.location.href,"index");
window.location.href = SlideHelper.NextLink + "?index=0&pre=" + encodeURIComponent(preurl);
}
else
SlideHelper.Next();
}
else if (SlideHelper.CurrentIndex>0 && nx<0.5)
{
SlideHelper.Pre();
}
else if(SlideHelper.CurrentIndex==0)
{
if(SlideHelper.PreDocUrl!='')
{
window.location.href = SlideHelper.PreDocUrl;
}
}
}
},
"getpos":function(element)
{
if ( arguments.length != 1 || element == null )
{
return null;
}
var elmt = element;
var offsetTop = elmt.offsetTop;
var offsetLeft = elmt.offsetLeft;
var offsetWidth = elmt.offsetWidth;
var offsetHeight = elmt.offsetHeight;
while( elmt = elmt.offsetParent )
{
if ( elmt.style.position == 'absolute'
// || elmt.style.position == 'relative'
|| ( elmt.style.overflow != 'visible' && elmt.style.overflow != '' ) )
{
break;
}
offsetTop += elmt.offsetTop;
offsetLeft += elmt.offsetLeft;
}
return {top:offsetTop, left:offsetLeft, right:offsetWidth+offsetLeft, bottom:offsetHeight+offsetTop };
},
/*
切换图片时图片幻灯展示的效果
*/
"ChangeImg":function()
{
if(SlideHelper.ShowTimeoutId)
{
clearTimeout(SlideHelper.ShowTimeoutId);
var transition = 12;//图片切换时渐变方式 1--23
var tranSpeed = 0.5;//图片切换渐变速度。 值越小速度越快
var oImg = SlideHelper.ImgObj;
if(!oImg) return;
if (document.all){
oImg.filters.revealTrans.apply();
}
if (document.all)
{
if(!this.tranRandom) oImg.filters.revealTrans.transition = transition;
oImg.style.visibility = "visible";
oImg.style.display ="";
oImg.filters.revealTrans.play(tranSpeed);
}
else
{
oImg.style.visibility = "visible";
}
}
}
};
/*
*函数功能:从href获得参数
*sArgName:arg1, arg2
*return: the value of arg. d, re
*/
function GetArgsFromHref(sHref, sArgName)
{
var args = sHref.split("?");
var retval = "";
if(args[0] == sHref) /*参数为空*/
{
return retval; /*无需做任何处理*/
}
var str = args[1];
args = str.split("&");
for(var i = 0; i < args.length; i ++)
{
str = args[i];
var arg = str.split("=");
if(arg.length <= 1) continue;
if(arg[0] == sArgName) retval = arg[1];
}
return retval;
}
function $(el)
{
if(!el)
{
return null;
}
else if(typeof el=='string')
{
return document.getElementById(el);
}
else if(typeof el=='object')
{
return el;
}
}
window.onload = function()
{
SlideHelper.ImgBox=$('tpj2_img');
SlideHelper.ThumbBox=$('thumbimg');
SlideHelper.CurNumBox=$('curImgNumBox');
SlideHelper.TotalNumBox=$('TotalImgNumBox');
SlideHelper.MemoBox =$('imgMemoBox');
//SlideHelper.PreBtn =$('pre1');
//SlideHelper.NextBtn =$('next1');
SlideHelper.PrePageBtn =$('tpj_pre');
SlideHelper.NextPageBtn =$('tpj_next');
SlideHelper.albumTitle =$('albumTitle');
SlideHelper.albumSummary =$('albumSummary');
SlideHelper.albumPubdate =$('albumPubdate');
SlideHelper.NextLink = '';
SlideHelper.Init(photojsondata);
}
发表评论
-
倒计时 传入 时间戳
2011-04-14 21:32 3850//计算倒计时 ,时间戳 id function j ... -
js 表单验证
2011-04-13 11:41 1079/*表单验证 调用1 validate_form(' ... -
jQuery去掉右键菜单
2011-03-15 14:34 958//去掉右键菜单 $(document).bind ... -
Textarea ---操作
2011-03-03 09:54 1064App = {}; App.byteLengt ... -
js 滚动
2011-01-21 11:09 1022转载: http://www.popub.net/ ... -
计算汉字长度
2010-11-15 16:24 861计算汉字长度 function strLen(s ... -
JavaScript Img onload 在 IE 7 失效的解决办法.
2010-08-19 09:19 2924转自: http://blog.mmclub.net/ind ... -
Aptana javascript eclipse插件
2010-04-27 13:45 1191http://www.radrails.org/radrail ... -
Javascript 设计模式pdf 和书中代码
2010-04-19 14:27 3645Javascript 设计模式: JavaScript. ... -
javascript防止发生默认浏览器行为通用函数
2010-04-16 12:33 871防止发生默认浏览器行为通用函数: <!DOCTYPE ... -
javascrip阻止事件冒泡的通用函数
2010-04-16 11:27 1024javascrip阻止事件冒泡的通用函数: <!DOC ... -
原型式继承的例子
2010-04-15 10:44 1282原型式继承的例子: <script>//为Pers ... -
set和get方法动态添加,这些方法在新对象实例化时创建
2010-04-15 09:54 1343动态生成方法的例子,这些方法在新对象实例化时创建: //创建 ... -
使用构造函数属性来判断对象的类型
2010-04-14 16:11 1032使用构造函数属性来判断对象的类型: //检查我们的数字 ... -
arguments 示例:一个接受任意数量参数并将其转为数组的函数
2010-04-12 15:07 1102一个接受任意数量参数并将其转为数组的函数: JavaScri ... -
对联广告效果
2010-02-05 13:04 871转载: <!DOCTYPE html PUBLIC &q ... -
javascript 学习笔记五 第七章 正则表达式
2009-10-30 14:57 1425第七章 正则表达式 JavaScript对正则表达式的支持 ... -
javascript 学习笔记四 第六章 DOM基础
2009-10-29 10:56 1235第六章 DOM基础 节点的层次 DOM定义了Nod ... -
javascript 学习笔记三 浏览器中的JavaScript
2009-10-23 09:34 937第五章 浏览器中的JavaScript BOM(浏览器对象模 ... -
getQueryParamValue 得到URL中的参数类似 request.getParamater("videoid")
2009-10-23 09:31 1536<html> <head> &l ...
相关推荐
本文介绍资源名称为“问卷星表单页面模仿-源码”的资源,该资源是一份代码实现的表单页面,模仿了问卷星表单页面的样式和功能。 该资源代码基于HTML、CSS、JavaScript编写而成,具有良好的代码可读性和可维护性。...
在Android应用开发中,"Android-模仿微信拾取图片图片截取拍照获取图片"是一个常见的需求,主要用于实现用户在应用内选择、截图或拍摄图片的功能。这个标题涉及到的知识点主要包含以下几个方面: 1. **多媒体文件...
"0-9印刷数字图片分类数据集"是一个专门用于图像识别任务的数据集,尤其适合初学者或者进行数字识别模型训练的项目。这个数据集包含了0到9这10个数字的印刷体图片,可以用于构建和训练深度学习模型,如卷积神经网络...
1.使用一个RootViewController作为根控制器; 2.在RootViewController的View中添加一个UIScrollView,设置内容大小为4倍屏幕宽; 3.创建4个子控制器,分别将它们的视图添加到UIScrollView中;...
请下载最新的v2.0.0版本,0积分下载地址: https://download.csdn.net/download/qq21497936/12319679 《红模仿的小作坊博客导航栏v2.0.0(作者:红模仿-红胖子).pdf》
1,jqzoom_ev-2.3 ----实现图片的局部放大效果 2,图片展示幻灯片风格-pptEffect ---图片以幻灯片的风格展示,效果有:a,可以...--模仿QQ中相册查询图片的风格 4,模仿QQ图片查看 --类似qq在微博中查看图片的风格。
这篇文档提供了关于红模仿的小作坊博客导航栏v2.0.0版本的详细信息,由作者红模仿-红胖子维护,并提供了博客链接供用户查询。文档内容涉及多个技术专栏,重点介绍了Qt开发、树莓派、三维、OpenCV、OpenGL、ffmpeg、...
【Android-PhotoselectionAPP模仿qq图片选择器】 在Android应用开发中,创建一个类似QQ图片选择器的组件是一项常见的需求。QQ图片选择器提供了一种直观、易用的界面,让用户可以方便地浏览和选择手机中的照片。下面...
这个“模仿腾讯网图片集左右查看代码”的项目,旨在帮助开发者了解和实践网页动态效果的实现,同时也为网页设计师提供了一种简单而实用的图片展示方案。通过学习和实践这个案例,你可以提升对前端开发中HTML、CSS和...
微信小程序-模仿知乎.rar微信小程序-模仿知乎.rar微信小程序-模仿知乎.rar微信小程序-模仿知乎.rar微信小程序-模仿知乎.rar微信小程序-模仿知乎.rar微信小程序-模仿知乎.rar微信小程序-模仿知乎.rar微信小程序-模仿...
以下是如何模仿MNIST数据集制作自己的数据集的详细步骤: 1. **数据收集**:首先,你需要收集与MNIST类似的图像数据。这些图像可以是手绘的,也可以是真实场景中的数字照片。确保图像清晰且大小一致,通常选择28x28...
【iOS开发:模仿支付宝集五福功能实现】 在iOS应用开发中,模仿支付宝集五福功能是一项具有挑战性的任务,因为它涉及到多个技术点,包括视图动画、用户交互设计、数据存储以及网络通信等。以下将详细介绍这个过程中...
本项目“图片放大镜--模仿淘宝”旨在实现类似的功能,让用户能够无损地放大图片以观察细节,提升购物体验。 在网页或应用开发中,图片放大镜功能主要由以下几个关键知识点构成: 1. **JavaScript与jQuery**:通常...
本文将详细讲解如何模仿QQ图片首页的轮播效果,这是一个非常适合初学者实践的项目。 首先,我们需要理解轮播的基本原理。图片轮播通常是通过在固定区域内显示一系列图片,通过定时切换或用户触发事件来实现图片的...
非模仿听力--two teenage girls.mp3
在本数据集“摔倒姿态图片数据集”中,重点是利用深度学习方法来识别和分析人类摔倒的姿态。该数据集源自2020年中国华录杯·数据湖算法大赛,旨在挑战计算机对人类运动安全性的理解和预测能力,特别是在监控视频场景...
在本文中,我们将深入探讨如何使用JavaScript(JS)来模仿QQ图片浏览的效果。这个效果包括了设置图片的间距,控制一次显示的图片数量,并在切换图片时,确保当前图片始终处于中间位置,以提供良好的用户体验。 首先...
资源介绍:源码调用了易语言扩展界面支持库和操作系统界面功能支持库,模仿实现QQ空间的图片浏览功能,点击图片的左边可以到上一张,点击图片的右边可以到下一张。资源作者:
在IT行业中,深度学习是一种基于人工神经网络的机器学习技术,它模仿人脑的工作原理,通过多层非线性变换对复杂数据进行建模。在本数据集"十二生肖---验证集and测试集"中,我们可以看到这是一份用于训练和评估深度...