Support » Plugins and Hacks » Suggestions for improvement to your plugin

Suggestions for improvement to your plugin

  • Your plugin works fine in webkit browsers like Chrome & Safari. However, there is an issue in Internet Explorer.

    For example…
    In Chrome the snow is created at the top of the viewport (visible window) and dies at the bottom of the viewport.
    In IE the snow is created and dies based on the vertical size of the html regardless of the browser’s window size. This means that if you have a long post you do not see many snowflakes because most are not within the browser window.

    I’m no javascript guru but, when I looked at your code I see browser tests for really ancient browsers like IE4, Netscape 4 & 6. My suggestion is to get rid of these old browser tests and simply convert some of your functions over to jQuery. WordPress loads jQuery anyway so why not use it?

    Following are updated functions for your consideration:

    function get_layer_by_name(id) {
    	return jQuery('#'+id).get(0);
    function move_to(obj, x, y, visible) {
    	if (visible) {
    			obj.style.left		= x+"px";
    			obj.style.top 		= y+"px";
    			obj.style.display 	= "block";
    	} else {
    			obj.style.display 	= "none";
    function write_to_layer(layer,txt) {
    function get_page_dimension() {
    		pageOffX   = jQuery(document).scrollLeft();
    		pageOffY   = jQuery(document).scrollTop();
    		pageWidth  = jQuery(window).width()  + pageOffX;
    		pageHeight = jQuery(window).height() + pageOffY;


  • The topic ‘Suggestions for improvement to your plugin’ is closed to new replies.