我如何在下面的代码中纠正我的问题? [英] How Can I Rectify My Problem In Below Code?

查看:69
本文介绍了我如何在下面的代码中纠正我的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$(document).ready(function(){

$(ul li)。click(function(){

var ind = $(this ).index();

$(#panel div:eq(+ ind +))。not($(this))。hide(); //隐藏所有全部选项卡内容

$(#panel div:eq(+ ind +))。show(); //仅用于显示当前标签

});

});







这个java脚本我想要当我单击相应的选项卡时显示选项卡内容...

如果我单击一个选项卡,只显示选项卡内容,其余全部隐藏..但在我的程序中,当前选项卡内容显示以及之前标签内容...如何隐藏???

这里面板是我的div id ....

$(document).ready(function () {
$("ul li").click(function () {
var ind = $(this).index();
$("#panel div:eq(" + ind + ")").not($(this)).hide();//for hiding remaining all tab contents
$("#panel div:eq(" + ind + ")").show(); //for display present tab only
});
});



in this java script i want to show tab content when i click respective tab...
and if i click one tab only that tab content will be showed remaining all are hide..but in my program present tab content showed as well as previous tab content...how to hide that???
here panel is my div id....

推荐答案

(ul li)。click(function(){

var ind =
("ul li").click(function () {
var ind =


(this).index();
(this).index();


(#panel div:eq(+ ind +))。not(
("#panel div:eq(" + ind + ")").not(


这篇关于我如何在下面的代码中纠正我的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆