大佬教程收集整理的这篇文章主要介绍了jquery ajax调用点击,只能工作一次,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我是jquery和javascript的新手,所以我很丢失.非常感谢你的帮助 :)
<script type="text/javascript"> $(document).ready(function(){ loadPage(); }); function loadPage(url) { if (url == undefined) { $('body').load('index.html header:first,#content,footer',hijackLinks); } else { $.get(url,function(data) { $('body').append(data); $('body>Meta').remove(); $('body>link').remove(); $('body>title').remove(); $('body').append(direction); sm = $(window).width(); if(direction == "leftnav"){ $('body>header:last,body>#content:last,footer:last').css("left","-" + sm + "px"); footerheight = $('body>#content:last').outerHeight(false) + $('body>header:last').outerHeight(true) ; $('footer:last').css("top",footerheight); $('body>header,body>#content,footer').css("-webkit-transition-duration","0.5s") $('body>header,footer').css("-webkit-transform","translate(" + sm + "px,0pX)"); }; if(direction != "leftnav"){ $('body>header:last,sm + "px"); footerheight = $('body>#content:last').outerHeight(false) + $('body>header:last').outerHeight(true) ; $('footer:last').css("top","translate(-" + sm + "px,0pX)"); }; setTimeout(function(){ $('body>header:not(:last),body>footer:not(:last),body>#content:not(:last)').remove() },500); setTimeout(function() { $('body>header,body>footer,body>#content').removeAttr('style') },500); }); } } function hijackLinks() { $('a').click(function(E){ e.preventDefault(); loadPage(e.target.href); direction = $(this).attr('class'); }); } </script>
以上是大佬教程为你收集整理的jquery ajax调用点击,只能工作一次全部内容,希望文章能够帮你解决jquery ajax调用点击,只能工作一次所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。