jQuery淘宝翻动图片

    科技2022-07-10  99

    CSS中代码:(小方块变换颜色)

    <style type="text/css"> .content_right .num li{ float: left; color: #FF7300; text-align: center; line-height: 16px; width: 16px; height: 16px; font-family: arial; font-size: 12px; cursor: pointer; overflow: hidden; margin: 3px 1px; border: 1px solid #FF7300; background-color: #FFFFFF; } </style> <script type="text/javascript"> $(function(){ $(".num li").bind("click mouseover",function(){ var index=$(this).index(); $(".slider").animate({ "top":(-150)*index+"px" }); $(this).addClass("on").siblings().removeClass("on"); }) }) </script>

    效果图如下: 触碰上去,小方块变颜色,鼠标滑动到下一个小方块,大图片向上↑翻动,小方块也变颜色。适用于淘宝等购物网站。

    Processed: 0.012, SQL: 8