若涉及js轉換html標籤,注意屬性問題動態:
$(document).off('click',".ticket_btn").on('click','.ticket_btn',function () {
var ticket = $('.ticket_input').val();
is_vote(ticket);
});
靜態:
$(document).ready(function() {
//彈層
$('.live_hd_enter .live_hd_enter_icon').click(function() {
$('.live_hd_enter .live_hd_enter_alert').toggle();
});
$('.live_hd_enter .live_hd_enter_icon .room_entrance_close').click(function() {
$('.live_hd_enter').hide();
});
});
多個類似標籤切換問題
$(".rnk_nav li").click(function(){
var index = $(".rnk_nav li").index(this);
$('.rnk_nav li').removeClass('selected');
$('.rnk_nav li').eq(index).addClass('selected');
$('.gfu_rank table').attr('style','display: none');
$('.gfu_rank table').eq(index).removeAttr('style');
});