jquery的问题,类似选项卡效果 jqueryfunction 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 帮忙修改下jquery,,点击一个其他3个隐藏,当前的显示。。 想要点击moreBtn,显示对应的moreMain $(".div1 a").on("click",function(){ $(this).next().show(); $(this).closest("div").siblings().find(".moreMain").hide(); })不知对不对,大概就这样吧 用这个http://download.csdn.net/detail/u010036886/8160957 $(document).ready(function(){ $(".moreMain").hide(); $(".div1:nth-child(2) .moreMain").show(); $(".div1").click(function(){ var Index = $(this).index(); $('.main').children('.div1').children('div').eq(Index).fadeIn().parent().siblings('div').hide(); });}); 写错了,这样可以$(document).ready(function(){ $(".moreMain").hide(); $(".div1:nth-child(2) .moreMain").show(); $(".div1").click(function(){ var Index = $(this).index(); $('.main').children('.div1').eq(Index).children('div').fadeIn(); $('.main').children('.div1').eq(Index).siblings().children('div').hide(); });}); 写错了,这样可以$(document).ready(function(){ $(".moreMain").hide(); $(".div1:nth-child(2) .moreMain").show(); $(".div1").click(function(){ var Index = $(this).index(); $('.main').children('.div1').eq(Index).children('div').fadeIn(); $('.main').children('.div1').eq(Index).siblings().children('div').hide(); });});谢谢! 正则老问题 !DOCTYPE 的区别! accessKey能定义多个一样的吗? javascript实现考试系统的到计时如何实现 请问怎样实现一个层的下拉? 下拉列表中内容过长问题!在线等 放大镜 求救 网页全屏显示 求助:怎么在JS文件中用document.writeln语句写入含字符变量的 链接点 ??? 我的分来咯!!! js 页面刷新问题window.location.href 用jsp实现input循环,实现对每条消息都能评论,但是只能对最新一条消息评论
$(this).next().show();
$(this).closest("div").siblings().find(".moreMain").hide();
})
不知对不对,大概就这样吧
$(document).ready(function(){
$(".moreMain").hide();
$(".div1:nth-child(2) .moreMain").show();
$(".div1").click(function(){
var Index = $(this).index();
$('.main').children('.div1').children('div').eq(Index).fadeIn().parent().siblings('div').hide();
});
});
$(document).ready(function(){
$(".moreMain").hide();
$(".div1:nth-child(2) .moreMain").show();
$(".div1").click(function(){
var Index = $(this).index();
$('.main').children('.div1').eq(Index).children('div').fadeIn();
$('.main').children('.div1').eq(Index).siblings().children('div').hide();
});
});
$(document).ready(function(){
$(".moreMain").hide();
$(".div1:nth-child(2) .moreMain").show();
$(".div1").click(function(){
var Index = $(this).index();
$('.main').children('.div1').eq(Index).children('div').fadeIn();
$('.main').children('.div1').eq(Index).siblings().children('div').hide();
});
});
谢谢!