【发布时间】:2013-03-10 16:50:17
【问题描述】:
我有一个类似的菜单:
<a href="http://www.something.it/project/">TYPE 1</a>
<a href="http://www.something.it/project/">TYPE 2</a>
...
我需要在加载项目页面时加载这个 jQuery:
$('ul#filters li').each(function() {
if(!$(this).hasClass('TYPE N')) {
$(this).fadeOut('normal').addClass('hidden');
} else {
$(this).fadeIn('slow').removeClass('hidden');
}});
href 必须通过 TYPE。如果我点击“Type 1”的链接,在项目页面加载后我需要加载:
$('ul#filters li').each(function() {
if(!$(this).hasClass('Type 1')) {
$(this).fadeOut('normal').addClass('hidden');
} else {
$(this).fadeIn('slow').removeClass('hidden');
}});
我该怎么做?
谢谢,
【问题讨论】:
标签: jquery parameter-passing href