mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-23 16:51:32 +01:00
A better addLoadEvent which kicks off when the DOM is ready instead onLoad, which kicks off after images finish. Code from Dean Edwards, Mathias Miller, John Resig, Jesse Skinner. Should speed up front-end execution.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
30145d1a56
commit
287edad647
@ -20,8 +20,7 @@ get_admin_page_title();
|
||||
<?php wp_admin_css(); ?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}
|
||||
//]]>
|
||||
addLoadEvent=(function(){var e=[],t,s,n,i,o,d=document,w=window,r='readyState',c='onreadystatechange',x=function(){n=1;clearInterval(t);while(i=e.shift())i();if(s)s[c]=''};return function(f){if(n)return f();if(!e[0]){d.addEventListener&&d.addEventListener("DOMContentLoaded",x,false);/*@cc_on@*//*@if(@_win32)d.write("<script id=__ie_onload defer src=//0><\/scr"+"ipt>");s=d.getElementById("__ie_onload");s[c]=function(){s[r]=="complete"&&x()};/*@end@*/if(/WebKit/i.test(navigator.userAgent))t=setInterval(function(){/loaded|complete/.test(d[r])&&x()},10);o=w.onload;w.onload=function(){x();o&&o()}}e.push(f)}})();//]]>
|
||||
</script>
|
||||
<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?>
|
||||
<style type="text/css">* html { overflow-x: hidden; }</style>
|
||||
|
Loading…
Reference in New Issue
Block a user