简体   繁体   中英

Why doesn't Standardista Table Sorting and HTML5 Snow effect work on one page?

If I put the two javascripts on one html page:

http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting

and

http://www.wilmslowastro.com/html5/snow/snowfall.js

the snowfall works great (very low cpu usage versus other snowfalls), but the Standardista Table Sorting doesn't anymore (until now it showd as a link when people wanted to sort tables, but now there is only the text, not a link).

Q: why? what could the problem be?

I tried to check for duplicate variables in the two scripts or something, but didn't found any. At least a hint please!

At the very end of the snowfall script is this:

// Prevent the script running on phone devices
if (!(/iphone|ipad|ipod|android|blackberry|mini|webos|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))) {
    window.onload = snowFall.init();
}

It will clobber any other scripts that try to handle the onload event of the window .

Have you tried changing the order you attach the scripts to the page? I'm assuming the snowfall script is added last?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM