亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

焦點圖片切換效果 兼容ie6 ie7 ff

系統 2594 0

1.對焦點圖片下方進行透明處理.兼容ie6ie7ff透明效果
2.通過鼠標移動到不同的四小圖片時,通過改變圖片所處父節點id=focus_change_list的left值取得效果
3.默認下每5秒執行一次函數autoFocusChange(),來實現圖片自動變換
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>
<title>焦點圖片</title>
<styletype="text/css">
/*Resetstyle*/
*{margin:0;padding:0;word-break:break-all;}
body{background:#FFF;color:#333;font:12px/1.6emHelvetica,Arial,sans-serif;}
h1,h2,h3,h4,h5,h6{font-size:1em;}
a{color:#039;text-decoration:none;}
a:hover{text-decoration:underline;}
ul,li{list-style:none;}
fieldset,img{border:none;}
em,strong,cite,th{font-style:normal;font-weight:normal;}
/*Focus_changestyle*/
#focus_change{position:relative;width:450px;height:295px;overflow:hidden;margin:20px01px60px;}
#focus_change_list{position:absolute;width:1800px;height:295px;}
#focus_change_listli{float:left;}
#focus_change_listliimg{width:450px;height:295px;}
.focus_change_opacity{position:absolute;width:450px;height:70px;top:225px;left:0;background:#000;filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5;}
#focus_change_btn{position:absolute;width:450px;height:65px;top:225px;left:0;}
#focus_change_btnul{padding-left:5px;}
#focus_change_btnli{display:inline;float:left;margin:015px;padding-top:12px;}
#focus_change_btnliimg{width:76px;height:50px;border:2pxsolid#888;}
#focus_change_btn.current{background:url(http://www.byzuo.cn/demo/focus_change/img/icon_arrow.gif)no-repeat37px8px;}
#focus_change_btn.currentimg{border-color:#EEE;}
</style>
<scripttype="text/javascript">
function$(id){returndocument.getElementById(id);}
functionmoveElement(elementID,final_x,final_y,interval){
if(!document.getElementById)returnfalse;
if(!document.getElementById(elementID))returnfalse;
varelem=document.getElementById(elementID);
if(elem.movement){
clearTimeout(elem.movement);
}
if(!elem.style.left){
elem.style.left="0px";
}
if(!elem.style.top){
elem.style.top="0px";
}
varxpos=parseInt(elem.style.left);
varypos=parseInt(elem.style.top);
if(xpos==final_x&&ypos==final_y){
returntrue;
}
if(xpos<final_x){
vardist=Math.ceil((final_x-xpos)/10);
xpos=xpos+dist;
}
if(xpos>final_x){
vardist=Math.ceil((xpos-final_x)/10);
xpos=xpos-dist;
}
if(ypos<final_y){
vardist=Math.ceil((final_y-ypos)/10);
ypos=ypos+dist;
}
if(ypos>final_y){
vardist=Math.ceil((ypos-final_y)/10);
ypos=ypos-dist;
}
elem.style.left=xpos+"px";
elem.style.top=ypos+"px";
varrepeat="moveElement('"+elementID+"',"+final_x+","+final_y+","+interval+")";
elem.movement=setTimeout(repeat,interval);
}
functionclassNormal(){
varfocusBtnList=$('focus_change_btn').getElementsByTagName('li');
for(vari=0;i<focusBtnList.length;i++){
focusBtnList[i].className='';
}
}
functionfocusChange(){
varfocusBtnList=$('focus_change_btn').getElementsByTagName('li');
focusBtnList[0].onmouseover=function(){
moveElement('focus_change_list',0,0,5);
classNormal()
focusBtnList[0].className='current'
}
focusBtnList[1].onmouseover=function(){
moveElement('focus_change_list',-450,0,5);
classNormal()
focusBtnList[1].className='current'
}
focusBtnList[2].onmouseover=function(){
moveElement('focus_change_list',-900,0,5);
classNormal()
focusBtnList[2].className='current'
}
focusBtnList[3].onmouseover=function(){
moveElement('focus_change_list',-1350,0,5);
classNormal()
focusBtnList[3].className='current'
}
}
setInterval('autoFocusChange()',5000);
functionautoFocusChange(){
varfocusBtnList=$('focus_change_btn').getElementsByTagName('li');
for(vari=0;i<focusBtnList.length;i++){
if(focusBtnList[i].className=='current'){
varcurrentNum=i;
}
}
if(currentNum==0){
moveElement('focus_change_list',-450,0,5);
classNormal()
focusBtnList[1].className='current'
}
if(currentNum==1){
moveElement('focus_change_list',-900,0,5);
classNormal()
focusBtnList[2].className='current'
}
if(currentNum==2){
moveElement('focus_change_list',-1350,0,5);
classNormal()
focusBtnList[3].className='current'
}
if(currentNum==3){
moveElement('focus_change_list',0,0,5);
classNormal()
focusBtnList[0].className='current'
}
}
window.onload=function(){
focusChange();
}
</script>
</head>
<body>
<divid="focus_change">
<divid="focus_change_list"style="top:0;left:0;">
<ul>
<li><imgsrc="focus_change/img/01.jpg"alt=""/></li>
<li><imgsrc="focus_change/img/02.jpg"alt=""/></li>
<li><imgsrc="focus_change/img/03.jpg"alt=""/></li>
<li><imgsrc="focus_change/img/04.jpg"alt=""/></li>
</ul>
</div>
<divclass="focus_change_opacity"></div>
<divid="focus_change_btn">
<ul>
<liclass="current"><ahref="#"><imgsrc="focus_change/img/btn_01.jpg"alt=""/></a></li>
<li><ahref="#"><imgsrc="focus_change/img/btn_02.jpg"alt=""/></a></li>
<li><ahref="#"><imgsrc="focus_change/img/btn_03.jpg"alt=""/></a></li>
<li><ahref="#"><imgsrc="focus_change/img/btn_04.jpg"alt=""/></a></li>
</ul>
</div>
</div>
</body>
</html>
http://www.corange.cn/archives/2008/09/1585.html

焦點圖片切換效果 兼容ie6 ie7 ff


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。?!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 5g影院天天5g天天爽精品 | 日韩欧美一二区 | 理论片 我不卡影院 | 欧美久久久久久 | 天天做天天爱夜夜大爽完整 | 日韩有码在线视频 | 亚洲成年人免费网站 | 毛片在线网址 | 二级片免费看 | 久久精品亚洲一区二区三区浴池 | 免费在线观看的毛片 | 麻豆精品国产免费观看 | 国内精品亚洲 | 亚洲综合色dddd26 | 日日干夜夜欢 | 国产福利第一视频 | 在线视频日韩精品 | 中文字幕丝袜在线56页 | 成人区精品一区二区毛片不卡 | 俺去鲁婷婷六月色综合 | 免费不卡中文字幕在线 | 亚洲图片综合区 | 国产福利免费在线观看 | 免费观看一区二区 | 久久99亚洲精品久久久久99 | 欧美成人天天综合天天在线 | 99视频国产热精品视频 | 大杳蕉伊人狼人久久一本线 | 精品久久免费观看 | 亚洲精品国产第一区二区多人 | 国产在线原创剧情麻豆 | 成人影院免费在线观看 | 老子理论不卡影院6080 | 久久黄色免费视频 | 雅虎日本免费一区二区三区 | 性久久久久久久久久 | 澳门久久精品 | 欧美成人精品一区二三区在线观看 | 国产日韩精品一区二区在线观看 | 青草操| 国产区在线观看 |