我遇到點擊事件問題。點擊其他具有事件的元素(點擊),不會像其他地方點擊一樣。我想要活動的一個元素或沒有。點擊其他
代碼:
$('span').click(function(){
var $this = $(this);
if($this.hasClass('active')){
$this.removeClass('active')}
else $this.addClass('active');
$('div').click(function(){
if (!$this.has(this).length) {
$this.removeClass('active');
}
});
return false;
});
我希望我能抓住你的問題......什麼是最終結果,你正在尋找? – VIDesignz