我之前尝试过这个问题,但我认为我没有像过去那样清楚。很抱歉重复,但我是新手,只是想弄清楚。我试图多次调用具有相同ID的函数。我猜这不可能,所以我需要做什么呢。我有noConflict因为我在页面上使用其他jquery版本。 scrollmenu引用其中一个。如果您在我正在处理的页面上,您将看到所有这些。 http://www.mac-av.com/test2/
$.noConflict();
jQuery(document).ready(function($)
{
$("#scrollmenu");
$("#e_emd").click(function () {
$("#e_em").show();
$("#e_v").delay(1200).fadeOut("slow");
$("#e_s").delay(1200).fadeOut("slow");
$("#e_l").delay(1200).fadeOut("slow");
});
$("#e_vd").click(function () {
$("#e_em").delay(1200).fadeOut("slow");
$("#e_v").show();
$("#e_s").delay(1200).fadeOut("slow");
$("#e_l").delay(1200).fadeOut("slow");
});
$("#e_sd").click(function () {
$("#e_em").delay(1200).fadeOut("slow");
$("#e_v").delay(1200).fadeOut("slow");
$("#e_s").show();
$("#e_l").delay(1200).fadeOut("slow");
});
$("#e_ld").click(function () {
$("#e_em").delay(1200).fadeOut("slow");
$("#e_v").delay(1200).fadeOut("slow");
$("#e_s").delay(1200).fadeOut("slow");
$("#e_l").show();
});
});
<div id="scrollmenua">|
<a id="e_emd" href="#Event_Management" class="panel">Event Management</a> |
<a id="e_vd" href="#Video" class="panel">Video</a> |
<a id="e_sd" href="#Sound" class="panel">Sound</a> |
<a id="e_ld" href="#Lighting" class="panel">Lighting & Staging</a> |
</div>
<div id="scrollmenub">|
<a id="e_emd" href="#Event_Management" class="panel">Event Management</a> |
<a id="e_vd" href="#Video" class="panel">Video</a> |
<a id="e_sd" href="#Sound" class="panel">Sound</a> |
<a id="e_ld" href="#Lighting" class="panel">Lighting & Staging</a> |
</div>
<div id="scrollmenub">|
<a id="e_emd" href="#Event_Management" class="panel">Event Management</a> |
<a id="e_vd" href="#Video" class="panel">Video</a> |
<a id="e_sd" href="#Sound" class="panel">Sound</a> |
<a id="e_ld" href="#Lighting" class="panel">Lighting & Staging</a> |
</div>
<div id="scrollmenub">|
<a id="e_emd" href="#Event_Management" class="panel">Event Management</a> |
<a id="e_vd" href="#Video" class="panel">Video</a> |
<a id="e_sd" href="#Sound" class="panel">Sound</a> |
<a id="e_ld" href="#Lighting" class="panel">Lighting & Staging</a> |
</div>
<div><img id="e_em" src="images/eventmanage.png" width="1037" height="480" /></div>
<div><img id="e_v" src="images/video.png" width="1128" height="480" /></div>
<div><img id="e_s" src="images/sound.png" width="1011" height="480" /></div>
<div><img id="e_l" src="images/light.png" width="1011" height="480" /></div>
答案 0 :(得分:0)
$('#other').click(function() {
$('#target').click();
});
让所有其他点击功能调用第一个或为它们分配所有类