解决方案 »
- scrollTop总是等于0
- 请教个JavaScript的问题,不知道怎么描述
- photofunia 网站技术
- JS随机函数random控制显示问题
- 这样取脚本的值为什么不行 <logic:iterate name="xmjhShow" id="bean" offet="javascript:index1" length="1">
- 如何在网页上实现拖拉选中效果?
- 注释中<!--test-->中的内容可以读出来嘛?
- 我的显卡驱动不支持windows server 2003我该怎么办??(OPENGL与Direct3D模式不支持)
- 这样的功能能实现吗?
- 关于JS的日期的问题,很简单哟,一时不记得啦
- TAB切换调juqery的方法,如何在同页面同时存在2个这样的方法,在线等
- 在ext 的grid中查找 将结果显示到grid中 多次查找结果叠加(不清空上次的查找结果)?
是调整了Panel同时调整里面一百个DIV的样式?
看得云里雾里的
前端输入引用这些class: nwj_conttab_1、nwj_conttab_2、nwj_conttab_3...nwj_conttab_10<div class="nwj_conttab_1"></div> <ul id="nwj_ul_1"></ul>
<div class="nwj_conttab_2"></div> <ul id="nwj_ul_2"></ul>
<div class="nwj_conttab_3"></div> <ul id="nwj_ul_3"></ul>JS部分就自动就是nwj_conttab_x
$(".mwj_contab_"+num+":first").show();
}
就是我要nwj_conttab_1、nwj_conttab_2、nwj_conttab_3...nwj_conttab_10JS部分能自动判断 nwj_conttab_x 的x数字是变的
大哥,对~~就是要这样!!但DIV那边不要循环~~DIV这边由我想用几个就用几个,我可能只要用5个
$("[class^=nwj_conttab_]").each(function(){
$(this).hide();
$(this).children().first().show();
});
$("[id^=nwj_ul_]").children().first().addClass("active").show();
终于,终于你懂了!!这样后台写了,前台不需要再写JS调用吧?直接<div class=".."></div> ?我试试去!感激
$("div[class*='nwj_conttab_']").each(function(i){
$(this).hide();
$("ul#nwj_ul_' + i + ' li:first").addClass("active").show();
$(".nwj_conttab_' + i + ':first").show();
});不知道是否可行。
从来了这个公司就没碰过jQ了,都忘干净了。
你后台<div class="nwj_conttab_x"></div>没问题
在前台的时候我可以遍历
大哥~~html玩的没问题~~程序不佳这是事实,干的就是切图的,只是JS太差!!我是地球来的,真的!
不过要改一下引号 $("div[class*='nwj_conttab_']").each(function(i){
$(this).hide();
$("ul#nwj_ul_" +i+ " li:first").addClass("active").show();
$(".nwj_conttab_" +i+ ":first").show();
if($(this).is(':visible')){
$(this).next().hide();
$("ul#nwj_ul_" +i+ " li:first").addClass("active").show();
$(".nwj_conttab_" +i+ ":first").show();
}
else{
$(this).next().toggle();
$("ul#nwj_ul_" +i+ " li:first").addClass("active").show();
}