这篇文章教大家用magento自带的javascript 就能做出slideshow 图片轮回效果。很简单的方法和步骤。 下面是js代码:
<scripttype="text/javascript"> start_slideshow(1, 3, 2000); function start_slideshow(start_frame, end_frame, delay) { setTimeout(switch_slides(start_frame,start_frame,end_frame, delay), delay); } function switch_slides(frame, start_frame, end_frame, delay) { return (function() { Effect.Fade('slide' + frame); if (frame == end_frame) { frame = start_frame; } else { frame = frame + 1; } setTimeout("Effect.Appear('slide" + frame + "');", 850); setTimeout(switch_slides(frame, start_frame, end_frame, delay), delay + 850); }) } </script><divid="introhomepage" height: 300px;"><divid="slide1"><div><ahref="http://topmagento.com/"><imgsrc='skin/frontend/default/default/images/slide1.jpg'/></a></div></div><divid="slide2"><div><ahref="http://topmagento.com/"><imgsrc='skin/frontend/default/default/images/slide2.jpg'/></a></div></div><divid="slide3"><div><ahref="http://topmagento.com/"><imgsrc='skin/frontend/default/default/images/slide3.jpg'/></a></div></div></div> |
利用magento自带的javascript做slideshow效果
最新推荐文章于 2021-07-05 17:47:53 发布