Late Loading Issues With jQuery Toggle (1 post)

  1. SpicyNumberOne
    Posted 2 years ago #

    I know this is more a jQuery issue than a WordPress issue, but no one in the jquery forums got back to me. At http://development.northwestdharma.org/group-directory/ you will see the first member groups's content display without the closed jquery toggle for about a second, and then all the member groups content appear a second later and close the toggles as I and my client want them to be. What can I do to make the toggle be closed BEFORE the content loads. I know one solution is whether you put the script in the head or at the end of the html, but I'm not getting different results when I move the scripts (I may be not moving them correctly). My jQuery script call is in the head and this is my code which appears in the head as well:

    //Toggle results
    jQuery(function($) {
    	$( '.toggle-next + *' ).hide();
    	$( '.toggle-next' ).click( function() {
    		$( this ).toggleClass( 'on' ).next().slideToggle( 'slow' );
    		return false;
    	} );

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by SpicyNumberOne
  • This topic is not resolved
  • WordPress version: 3.7.1