在线求助,要在此方法上写多个应用

vanshion 2011-01-06 05:35:06
如下代码,我现在需要实现的功能是$(this).find("ul, .con1_hide_table")这个里面的con1_hide_table的数字1是能变的,比如$(this).find("ul, .con2_hide_table")、$(this).find("ul, .con3_hide_table")、$(this).find("ul, .con4_hide_table").....$(this).find("ul, .con100_hide_table")

跪求改法!

最好附上前台怎么调用这个1、2、3、4、5....100

$(document).ready(function(){

$.fn.adjustPanel = function(){
$(this).find("ul, .con1_hide_table").css({ 'overflow' : 'hidden'}); //Reset subpanel and ul height
};
$(".con1_hide").adjustPanel();
$(window).resize(function () {
$(".con1_hide").adjustPanel();
});
$(".con1_hide a:first").click(function() {
if($(this).next(".con1_hide_table").is(':visible')){
$(this).next(".con1_hide_table").slideUp();
$(".con1_hide a").removeClass('active');
}
else {
$(".con1_hide_table").slideUp();
$(this).next(".con1_hide_table").slideToggle();
$(".con1_hide a").removeClass('active');
$(this).toggleClass('active');
}
return false;
});

});
...全文
144 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
vanshion 2011-01-07
  • 打赏
  • 举报
回复
36分,另外两位朋友也很热心!
vanshion 2011-01-07
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 crazywa 的回复:]

听说有分拿,我来蹭~
[/Quote]

感谢Crazywa同学在此贴http://topic.csdn.net/u/20110107/14/4e2228b8-e0ad-4806-81c3-5c67e8ff2e6e.html
处解决了问题,故信守诺言,40分付于他
Crazywa 2011-01-07
  • 打赏
  • 举报
回复
听说有分拿,我来蹭~
Mr-Jee 2011-01-07
  • 打赏
  • 举报
回复
我靠。。什么叫前端能调用
你是不是一点不会?

需要for循环吗
这个获取到的就是所有class以hide_table结尾的元素。满足你的要求了
如果你要对齐操作在这后面.each();去操作去吧
$(this).find("[class$=hide_table]")
vanshion 2011-01-07
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 cj205 的回复:]

$(this).find("ul, .con1_hide_table")?

$("[class$=hide_table]")
[/Quote]

我是要前端能调用

<div class="con1_hide_table"></div>

<div class="con2_hide_table"></div>

<div class="con3_hide_table"></div>

....等等~~
Mr-Jee 2011-01-07
  • 打赏
  • 举报
回复
$(this).find("ul, .con1_hide_table")?

$("[class$=hide_table]")
vanshion 2011-01-07
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 bin_520_yan 的回复:]

JScript code

for(int i=1;i<=100;i++)
{
$(this).find("ul, .con"+i+"_hide_table").css({ 'overflow' : 'hidden'});
}
[/Quote]

哥,能写全一点吗? 格式有错~~贴进代码后
DataBox-MDX 2011-01-06
  • 打赏
  • 举报
回复

for(int i=1;i<=100;i++)
{
$(this).find("ul, .con"+i+"_hide_table").css({ 'overflow' : 'hidden'});
}

87,924

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧