關(guān)于jquery左右滾動(dòng)圖片代碼的信息
思路點(diǎn)擊左邊 1將第一個(gè)LI向左滑動(dòng),滑動(dòng)的數(shù)值就是LI的寬度這里是用負(fù)marginleft來(lái)實(shí)現(xiàn)移動(dòng)2滑動(dòng)完成后,將這個(gè)LI插入到整個(gè)LI的最后一個(gè)實(shí)現(xiàn)無(wú)縫滾動(dòng)點(diǎn)擊右邊 1將最后一個(gè)LI插入到所有LI的第。
getElementByIdquotsmallDivquotstylepixelLeft注意大小寫(xiě)最好用scrollLeft比如documentgetElementByIdquotsmallDivquotscrollLeft = 55滾動(dòng)起來(lái)卡頓現(xiàn)象好點(diǎn) 我不知道上面是不是你的全部代碼,反正相應(yīng)的onclick要加的。
將javascript代碼替換為如下,jQueryquotscroolWarpquotslide titCellquothd ulquot, mainCellquotbd ulquot,effectquotleftquot,vis6,scroll6,autoPlaytrue,autoPagetrue。
documentreadyfunction quot#hidequotclickfunction if$quot#leftquotcss#39width#39 == #39200px#39 quot#leftquotanimatewidth0,quotslowquotquot#hidequotval#39顯示#39else quot#leftquotanimate。
這樣lt!DOCTYPE html 動(dòng)態(tài)切換圖片 ul padding0margin0 li liststyle pic position relativewidth 400pxheight 400pxbackgroundcolorredmargin100px autobackgroundurl#39。
掃描二維碼推送至手機(jī)訪問(wèn)。
版權(quán)聲明:本文由飛速云SEO網(wǎng)絡(luò)優(yōu)化推廣發(fā)布,如需轉(zhuǎn)載請(qǐng)注明出處。