<script type="text/javascript">
var adNum=0;
var _Images=new Array(8);
var adNum=0;
var imgindex=1;
_Images[0] = new Image();
_Images[0].src="http://q.yesky.com/pictures/2007/05/1591020_74591936.jpg";
_Images[0]=setImgSize(_Images[0]);
imgindex++;
_Images[1] = new Image();
_Images[1].src="http://q.yesky.com/pictures/2007/05/1591020_77091929.jpg";
_Images[1]=setImgSize(_Images[1]);
imgindex++;
_Images[2] = new Image();
_Images[2].src="http://q.yesky.com/pictures/2007/04/1591020_50424051.jpg";
_Images[2]=setImgSize(_Images[2]);
imgindex++;
_Images[3] = new Image();
_Images[3].src="http://q.yesky.com/pictures/2007/04/1591020_92004051.jpg";
_Images[3]=setImgSize(_Images[3]);
imgindex++;
_Images[4] = new Image();
_Images[4].src="http://q.yesky.com/pictures/2007/04/1591020_64983805.jpg";
_Images[4]=setImgSize(_Images[4]);
imgindex++;
_Images[5] = new Image();
_Images[5].src="http://q.yesky.com/pictures/2007/04/1591020_99503805.jpg";
_Images[5]=setImgSize(_Images[5]);
imgindex++;
_Images[6] = new Image();
_Images[6].src="http://q.yesky.com/pictures/2007/04/1591020_72235914.jpg";
_Images[6]=setImgSize(_Images[6]);
imgindex++;
_Images[7] = new Image();
_Images[7].src="http://q.yesky.com/pictures/2007/04/1591020_64505914.jpg";
_Images[7]=setImgSize(_Images[7]);
imgindex++;
<!--
var totel=8; //图片总数
var i=Math.floor(Math.random()*totel)+1;
var play=0;
function findObj(n, d){
var p,i,x;
if(!d)d=document;
if((p=n.indexOf("?"))>0 && parent.frames.length){
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);
}
if(!(x=d[n]) && d.all)x=d.all[n];
for(i=0; !x && i<d.forms.length; i++)x=d.forms[i][n];
for(i=0; !x && d.layers && i<d.layers.length; i++)x=findObj(n,d.layers[i].document);
if(!x && d.getElementById)x=d.getElementById(n);
return x;
}
function view(){
next();
viewtimeout();
}
function viewtimeout(){
if(play==0){
setTimeout(function(){
view();
},parseInt(findObj('timeoutnum').value)*1000);
}
}
function back(){
if(i==0)i=totel+1;
i--;
findObj('switch_photo').src=_Images[i].src;
findObj('switch_photo').width=_Images[i].width;
findObj('switch_photo').height=_Images[i].height;
findObj('switch_photo_href').href=_Images[i].src;
//findObj('pictext').innerHTML=imgTitle[i];
// findObj('q').value=i;
}
function next(){
if(i==totel-1)i=0;
i++;
findObj('switch_photo').src=_Images[i].src;
findObj('switch_photo').width=_Images[i].width;
findObj('switch_photo').height=_Images[i].height;
findObj('switch_photo_href').href=_Images[i].src;
//alert(_Images[i].src+"<>"+_Images[i].width+"*"+_Images[i].height);
// findObj('pictext').innerHTML=imgTitle[i];
//findObj('q').value=i;
}
function go(){
if(findObj('q').value<totel+1 && findObj('q').value>0){
i=findObj('q').value;
findObj('switch_photo').src=_Images[i].src;
findObj('switch_photo').width=_Images[i].width;
findObj('switch_photo').height=_Images[i].height;
findObj('switch_photo_href').href=_Images[i].src;
// findObj('pictext').innerHTML=imgTitle[i];
}else{
alert('error!');
}
}
function entergo(){
if(event.keyCode==13)eval('go()');
}
function pageload(){
//findObj('pictext').innerHTML=imgTitle[i];
//findObj('q').value=i;
}
function imgload(){
document.write('<a href="" id="switch_photo_href" target="_blank"><img id="switch_photo" class="mgauto" src="'+_Images[i].src+'" width="'+_Images[i].width+'" height="'+_Images[i].height+'" border="0"/></a>');
}
function setImgSize(img)
{
var maxWidth=240;
var maxHeight=180;
if(img.width > maxWidth)
{
var temp=maxWidth/img.width;
img.width = maxWidth;
img.height=img.height*temp;
}
if(img.height > maxHeight){
var temp1=maxHeight/img.height;
img.height = maxHeight;
img.width=img.width*temp1;
}
return img;
}
//-->
</script>
<div class="pd9 floatleft mgleft19 inline"><table><tr><td width="240" height="180" align="center"><script type="text/JavaScript">imgload();</script></td></tr></table></div>
<div id="switcher" class="clear height29 ">
<span class="floatleft mgleft11 ">
<a href="javascript:void(0);" style="display:none;" id="viewstop" onclick="play=1;findObj('viewplay').style.display='';this.style.display='none';">
<img class="mgleft3 floatleft " src="/images/home/switch_pause.gif" width="20" height="20" alt="暂停" border="0" /></a>
<a href="javascript:void(0);" id="viewplay" onclick="play=0;findObj('viewstop').style.display='';this.style.display='none';view();">
<img class="mgleft3 floatleft" src="/images/home/switch_stop.gif" width="20" height="20" alt="播放" border="0" /></a>
<a href="javascript:void(0);" id="backs" onClick="back();">
<img class="mgleft3 floatleft" src="/images/home/switch_previous.gif" width="20" height="20" alt="上一个" border="0" /></a>
<a href="javascript:void(0);" id="gtname" onClick="next();">
<img class="mgleft3 floatleft" src="/images/home/switch_next.gif" width="20" height="20" alt="下一个" border="0" /></a></span>
<span class="floatright mgright5 pdtop5" >
<a href="#" >查看所有相册>></a>
<input type="hidden" id="timeoutnum" value="2"/>
<script>
play=0;
findObj('viewstop').style.display='';
findObj('viewplay').style.display='none';
view();
</script>
</span>
</div>
</div>
分享到:
相关推荐
兼容ie及firefox的flash相册,不容错过!希望能给大家帮助!
JavaScript的相册滑动效果 用火狐跟IE都兼容
注意:关于浏览器兼容插件的使用说明,由于部分用户喜欢使用google或者火狐浏览器,而这部分非IE内核浏览器对编辑器兼容不是很好,出现显示错误等情况,为此,我们提供了兼容插件,如果你所使用的浏览器并不是google...
基于baguetteBox的轻量级图片特效插件,支持自适应屏幕大小的js图片相册浏览特效代码,代码简洁易用,推荐下载。兼容IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗。
javascript椭圆旋转相册 兼容IE6 7 8 9 10 chrome firefox浏览器 博客地址:http://www.cnblogs.com/Cson/
Html+css3实现的炫酷3D旋转相册 文件齐全 代码和图片 利用chrome或者火狐 浏览器测试查看 没有写浏览器兼容 IE低版本可能显示不了
56.完美兼容firefox等其它非IE内核浏览器。 57.三层架构模式开发,扩充及调用更方便。 58.内含ajax文件操作技术,更加提高用户体验,提高系统运行效率。 59.分简体版、繁体版、英文版三种版本。 60.可以和《桃源...
注意:关于浏览器兼容插件的使用说明,由于部分用户喜欢使用google或者火狐浏览器,而这部分非IE内核浏览器对编辑器兼容不是很好,出现显示错误等情况,为此,我们提供了兼容插件,如果你所使用的浏览器并不是google...
兼容各种主流浏览器:chrome Firefox IE ... IE7以上都兼容,IE6没试过。 因为Uploadify是用flash做的,所以如果浏览器上面看不到"上传"按钮,请先检查你的flash是否已安装。 压缩包里包含两个项目,一个是多图上传...
html5 css3 js 实现动画效果.兼容ie7到11及谷歌火狐等浏览器.
56.完美兼容firefox等其它非IE内核浏览器。 57.三层架构模式开发,扩充及调用更方便。 58.内含ajax文件操作技术,更加提高用户体验,提高系统运行效率。 59.分简体版、繁体版、英文版三种版本。 60.可以和《桃源...
3.模板有很多细节都有体现,同时对官方模板文件结构和功能位置做了更为优化的设计处理,无论是在前端界面上还是在CCS代码优化上,兼容主流浏览器,ie6-ie10,谷歌火狐等。 4.模板对css3支持很多,用谷歌火狐以及ie9...
html5 css3 js 实现动画效果. 兼容ie7到11及谷歌,火狐等浏览器.
jQuery模拟的WIN8 卡片式界面UI特效,运用CSS3,jQuery等web前端技术模拟的win8的卡片,在兼容性方面,支持IE9,chrome,safari,opera,firefox(chrome显示效果最佳) 等众多主流的Web浏览器。 示例在编写时...
为兼容firefox等非ie浏览器,增加了对ubb编辑器的支持,并增加了灾难恢复等编辑器实用功能。 上传部分重新设计,可支持组件上传,并改进了用户文件管理方式。 增加了相册,短信,好友等用户实用功能。 增加了...
自媒体二号是一款WordPress主题,主题采用三栏设计布局,左侧导航栏可添加彩色小图标,具有强烈的视觉冲击效果。首页内容可展示幻灯片...完美兼容IE9+、Chrome、Firefox、Safari、360等主流浏览器,针对mac OS等Retina
该系统采用最流行的ASP ACCESS进行搭建,页面使用DIV CSS进行编写,全面兼容时下IE6、IE7、IE8、FIREFOX、360等主流浏览器。系统内置多款主题及精美相册,后台一键切换。前台所有内容均可以在后台进行修改删除等操作...
* 添加了自定义模块克隆功能 * 增加了相册浏览时胶片自动居中的功能以及缩略图的分步加载 * 增加了Firefox下自定义模块的安全脚本支持 * 取消了输出时的gzip压缩方便二次开发时使用aspx文件(官方近期会...
2. 支持html5,兼容全部主流浏览器,包括firefox, chrome, IE, 搜狗, 360等。(兼容手机浏览器UC等)3. 多种主流数据库支持,一套程序多种数据库间任意切换,支持 sql server. oracle. access. mysql。4. 新增相册...