我是jQuery的新手,似乎不能让这段代码工作。第一条语句执行,但后两条语句不执行。请帮帮忙。
$(document).ready(function(){
$("#print-tab").click(function(){
$("#print-content").hide().fadeIn();
});
$("#web-tab").click(function(){
$("#web-content").hide().fadeIn();
});
$("#rest-tab").click(function(){
$("#rest-content").hide().fadeIn();
});
});发布于 2012-07-31 20:49:10
会不会是因为你的#print-content在其他内容之上,而你从来没有隐藏过它。你能不能试试:
$(document).ready(function(){
$("#print-tab").click(function(){
$("#web-content,#rest-content").fadeOut();
$("#print-content").hide().fadeIn();
});
$("#web-tab").click(function(){
$("#print-content,#rest-content").fadeOut();
$("#web-content").hide().fadeIn();
});
$("#rest-tab").click(function(){
$("#web-content,#print-content").fadeOut();
$("#rest-content").hide().fadeIn();
});
});https://stackoverflow.com/questions/11680375
复制相似问题