亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

left的值在網頁里總是不對,用的別人的模板

left的值在網頁里總是不對,用的別人的模板

var myLeft;?? ? ? ?rePoint();? ? function rePoint() {?? ? ? ? var myLeftNumber = parseInt((document.body.clientWidth - 1100) / 2);?? ? ? ? if (myLeftNumber < 0) {?? ? ? ? ? ? myLeftNumber = 0;?? ? ? ? }? ? ? ? if (myLeft == myLeftNumber) {?? ? ? ? ? ? return;?? ? ? ? }? ? ? ? myLeft = myLeftNumber;?? ? }? hidden.css({width:"1100px",height:"375px",top:"0","left":"0px","opacity":0,}); hidden.stop(true,true).animate({width:"1100px",height:"375px",top:"0",left:"0px",opacity:1,},timer); curr.stop(true,true).animate({width:"1100px",height:"375px",top:"0","left":"50%",opacity:1,},timer); next.stop(true,true).animate({width:"1100px",height:"375px",top:"0","left":"0px","opacity":0,},timer,function(){next.find("span").css("opacity",0); isMoving = false;}); //prev ?--> ?curr ? ? prev中的圖片li輪換到curr的位置 ? ? ?其他一次輪換 prev.find("span").css("opacity",0); $(".main_banner_box li").find("p").css({"bottom":"-50px"});//所有標題隱藏 prev.stop(true,true).animate({width:"1100px",height:"375px",left:"myLeft",top:0,opacity:1},timer,function(){ $(this).find("p").animate({"bottom":"0px"}); //當前這張圖片的標題運動出來 }); index_2--; }else{ //執行next 操作 if(index_2+2>=len){ //index_2 3 4 hidden=$("#imgCard"+(index_2+2-len));// 0 1 }else{ //index_2 0 1 2 hidden=$("#imgCard"+(index_2+2));// 2 3 4 } prev.css("z-index","1"); next.css("z-index","5"); //點擊next按鈕 ?讓next位置上的這張圖片 層級最高 顯示 curr.css("z-index","2"); hidden.css("z-index","1"); //當index_2自增,各圖片往左運動效果 hidden.css({width:"1100px",height:"375px",top:"0px","left":"50%","opacity":0}); hidden.stop(true,true).animate({width:"1100px",height:"375px",top:"0px",opacity:1},timer); curr.stop(true,true).animate({width:"1100px",height:"375px",top:"0px",left:"0px",opacity:1},timer); //next ?--> ?curr ? ? next中的圖片li輪換到curr的位置 ? ? ?其他一次輪換 next.find("span").css("opacity",0); $(".main_banner_box li").find("p").css({"bottom":"-50px"});//所有標題隱藏 next.stop(true,true).animate({width:"1100px",height:"375px",left:"myLeft",top:0,opacity:1,margin:"0 auto"},timer,function(){ $(this).find("p").animate({"bottom":"0px"}); //當前這張圖片的標題運動出來 }); prev.stop(true,true).animate({width:"1100px",height:"375px",left:"0px",top:"0px",opacity:0},timer,function(){ isMoving = false; });? index_2++; }
查看完整描述

1 回答

?
lxmhh3788029

TA貢獻15條經驗 獲得超2個贊

我姑且一說哈,沒有實際運行你的程序,只是掃了一下發現left:"myLeft"這樣寫是不對的,你的myLeft是一個變量,不用加引號,就寫left:myLeft就行了

查看完整回答
反對 回復 2017-08-07
  • 1 回答
  • 0 關注
  • 1575 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號