jQuery
[jQuery] 錨點滑動
$('#float_banner').click(function(){ $('html,body').animate({scrollTop:$('.game_full').offset().top}, 1200, 'easeOutQuart');});
[jQuery] 刪除元素 及 清空元素
刪除元素
$("#div1").remove();
清空元素
$("#div1").empty();
[jQuery]on() 來綁定事件
$(document).on('click', '#my_selector', function(){
});
[jQuery] 資料載入中的loading等待畫面
$(function(){
$("#div_loading").ajaxStart(function(){
$(this).show();
$("#div_content").hide();
}).ajaxStop(function(){
$(this).hide();
$("#div_content").show();
});
});
html的部分:
<div id="div_loading">
<img src="load.gif" />
</div>
<div id="div_content">
網頁主內容
</div>
$('#float_banner').click(function(){ $('html,body').animate({scrollTop:$('.game_full').offset().top}, 1200, 'easeOutQuart');});
[jQuery] 刪除元素 及 清空元素
刪除元素
$("#div1").remove();
清空元素
$("#div1").empty();
[jQuery]on() 來綁定事件
$(document).on('click', '#my_selector', function(){
});
[jQuery] 資料載入中的loading等待畫面
$(function(){
$("#div_loading").ajaxStart(function(){
$(this).show();
$("#div_content").hide();
}).ajaxStop(function(){
$(this).hide();
$("#div_content").show();
});
});
html的部分:
<div id="div_loading">
<img src="load.gif" />
</div>
<div id="div_content">
網頁主內容
</div>
留言
張貼留言