Difference between revisions of "Template:Loading"
From referenceTSS
m |
m |
||
Line 48: | Line 48: | ||
cPreloaderTimeout=setTimeout('continueAnimation()', SECONDS_BETWEEN_FRAMES*1000); | cPreloaderTimeout=setTimeout('continueAnimation()', SECONDS_BETWEEN_FRAMES*1000); | ||
} | } | ||
+ | |||
+ | function stopAnimation(){//stops animation | ||
+ | clearTimeout(cPreloaderTimeout); | ||
+ | cPreloaderTimeout=false; | ||
+ | } | ||
+ | |||
+ | function imageLoader(s, fun)//Pre-loads the sprites image | ||
+ | { | ||
+ | clearTimeout(cImageTimeout); | ||
+ | cImageTimeout=0; | ||
+ | genImage = new Image(); | ||
+ | genImage.onload=function (){cImageTimeout=setTimeout(fun, 0)}; | ||
+ | genImage.onerror=new Function('alert(\'Could not load the image\')'); | ||
+ | genImage.src=s; | ||
+ | } | ||
+ | |||
+ | //The following code starts the animation | ||
+ | new imageLoader(cImageSrc, 'startAnimation()'); | ||
+ | |||
+ | $(document).on("click", "a", function() { | ||
+ | //this == the link that was clicked | ||
+ | var href = $(this).attr("href"); | ||
+ | if(href!=null){ | ||
+ | var url=String(href); | ||
+ | if(String(href).indexOf("resource_browser")!=-1){ | ||
+ | if(String(href).length>2){ | ||
+ | toggle_visibility('loader'); | ||
+ | |||
+ | }else{ | ||
+ | } | ||
+ | }else{ | ||
+ | } | ||
+ | }else{ | ||
+ | } | ||
+ | }); | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 15:16, 20 December 2017