• wplearner

    (@wordpresslearner)


    hey, so I have jquery loaded from default instalation, and called in functions php on init along with a couple other scripts.. Basically I get this annoying little flash before the jquery “kicks in.”

    like say I had a basic jquery script that turned all paragraphs green. What happens is I get a flash of grey text, and then it turns green..Anyone know how to get arround this, or somehow get jquery to load sooner? thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator cubecolour

    (@numeeja)

    If you post a link to your site, people can see what is happening and may be better placed to offer worthwhile suggestions.

    Thread Starter wplearner

    (@wordpresslearner)

    sure, keep in mind it’s basically being used as a test site:

    https://www.spanishtranslator.me/

    I have a small script called jtruncate that cuts the text and puts a “read more” link..you can see when you load the page it starts with the whole text and then jumps to the trunkated version. same thing happens with any other jquery script.. also here’s the code in functions php:

    <?php
     function my_init() {
    	if (!is_admin()) {
    
    		wp_enqueue_script('jquery');
    	wp_enqueue_script("easeit",get_bloginfo('stylesheet_directory')."/easen.js", array('jquery'));
    
        wp_enqueue_script('newscript', 'https://kwicks.googlecode.com/svn/branches/v1.5.1/Kwicks/jquery.kwicks-1.5.1.pack.js');
    
    }
    }
    add_action('init', 'my_init'); ?>
    
    <?php
    function quick3() {
    
    wp_enqueue_script("trial",get_bloginfo('stylesheet_directory')."/trial.js", array('jquery','newscript','easeit'));
            wp_enqueue_script("more",get_bloginfo('stylesheet_directory')."/moreit.js", array('jquery',));
        wp_enqueue_script("trunker",get_bloginfo('stylesheet_directory')."/trunkit.js", array('jquery','more'));
    }
    add_action('init','quick3');
    
    ?>
    Thread Starter wplearner

    (@wordpresslearner)

    also the p color styling is done via jquery..

    Thread Starter wplearner

    (@wordpresslearner)

    hoping someone out there knows how to fix this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘annoying flash before jquery loads- pls help’ is closed to new replies.