由于wap模板没办法用pc模板的数字自增变量及灵动标签自增,或是我不懂使用。
贴出js代码,很菜,所以请大神帮助。谢谢
<script type="text/javascript"> //index news show_more function show_more(i) { $(".news_list dl:not(.dl" + i + ")").each(function() { $(this).find('dt').show(); $(this).find('.t').hide(); $(this).find('.spec').hide(); }); $(".dl" + i).find('dt').hide(); $(".dl" + i).find('.t').show(); $(".dl" + i).find('.spec').show(); } TouchSlide({ slideCell: "#focus", titCell: ".hd ul", //开启自动分页 autoPage:true ,此时设置 titCell 为导航元素包裹层 mainCell: ".bd ul", effect: "left", autoPlay: true, //自动播放 autoPage: true, //自动分页 switchLoad: "_src" //切换加载,真实图片路径为"_src" }); // $('.preloader').fadeOut('300', function() { // $('.body').css('opacity', 1); // }); </script>
实现如下效果: <dl class="dl1"><dt onClick="show_more('1')"> <dl class="dl2"><dt onClick="show_more('2')"> <dl class="dl3"><dt onClick="show_more('3')">
其中里面的数字处应该怎么填写变量,谢谢
|