任何人都可以指出爲什麼我無法在第一次點擊時獲得警報彈出的問題嗎?它僅適用於每次點擊(即不適用於奇數點擊並適用於偶數點擊)。只有第二次點擊的jQuery工作
HTML:
<div class="slider">
<div class="slider-box ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
<a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 50%;"></a>
</div>
</div>
的jQuery:
$(document).ready(function() {
$("a.ui-slider-handle").click(function() {
alert('test');
});
});
我也試過,但沒有工作
$(document).ready(function() {
$("a.ui-slider-handle").mousedown(function() {
alert('test');
});
});
對我的作品 - > http://jsfiddle.net/3zEX5/ – adeneo
是這個jQuery的ui滑塊? –
可能存在干擾點擊事件的事情,如另一個點擊事件。 – bjb568