ページ上の複数の項目のいずれかがクリックされた場合に実行される関数があります。この関数は機能しますが、私はちょうどそこに||
またはそれに類するものを使ってリストするより良い方法があることを知りたいと思います。複数のトリガーを持つ1つの機能。 JQUERY
これは私がこれまで持っているものです。
Init: function() {
$('#indian-marker a').click(Operations.ShowIndia);
$('#map-2 a').click(Operations.ShowIndia);
$('#details-marker a').click(Operations.ShowIndia);
},
ShowIndia: function() {
$('#map').css('background-image', 'url("../img/map-background-india.jpg")');
$('#map-return').show();
$('#india-box-link').toggle();
$('#global-box-link').toggle();
return false;
}
http://api.jquery.com/multiple-selector/よりもこの答えで – nnnnnn