• Resolved beelzebomb

    (@beelzebomb)


    Using the following jQuery code my fade menu buttons work fine on index.php – but when I click the title & go to single.php the fade doesn’t work.

    I can see no reason for it to fail as it calls the same header.php that index.php does.. Any ideas (without rewriting the code please, as this is what I am used to!) ?

    <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
    <script type="text/javascript">
    	jQuery(document).ready(function() {
    		jQuery('.static,.home,.about,.services,.pricing,.email,.contact,.portfolio').append('<span class="hover"></span>').each(function () {
    	  		var jQueryspan = jQuery('> span.hover', this).css('opacity', 0);
    	  		jQuery(this).hover(function () {
    	    		jQueryspan.stop().fadeTo(800, 1);
    	 		}, function () {
    	   	jQueryspan.stop().fadeTo(800, 0);
    	  		});
    		});
    	});
    </script>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter beelzebomb

    (@beelzebomb)

    Hi esmi short fast & effective reply! Many thanks.

    For anyone else out there with similar issues, the solution was to place the following code directly ABOVE my jQuery code in header.php – still curious as to why index.php was fine but single.php wasn’t though..

    <?php wp_enqueue_script("jquery"); ?>
    
    <?php wp_head(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘jQuery fade buttons not working on single.php’ is closed to new replies.