WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Superfish -jquery issue (3 posts)

  1. johnywhy
    Member
    Posted 5 years ago #

    this jquery DOES work, at the top of the <body> secion, in my header.php, and with the wp_enqueue_script function in my functions.php.

    <script type="text/javascript">
    		jQuery(document).ready(function() {
       			jQuery("a.hello").click(function() {
         			 alert("Hello world!");
       			});
     		});
    </script>
    <a class="hello" href="#">Click Me</a>

    (above works fine)

    HOWEVER, the following declarations fail to properly load a <ul> into a superfish.

    <link rel="stylesheet" type="text/css" href="fish/superfish.css" media="screen">
    <script type="text/javascript" src="fish/jquery-1.2.6.min.js"></script>
    <script type="text/javascript" src="fish/hoverIntent.js"></script>
    <script type="text/javascript" src="fish/superfish.js"></script>
    <link rel="stylesheet" type="text/css" media="screen" href="fish/superfish-vertical.css" /> 
    
    <script type="text/javascript">
    // initialise plugins
    jQuery(function(){
    	jQuery('ul.sf-menu').superfish();
    });
    </script>

    these same declarations DO properly load a superfish in a stand-alone html file.

  2. johnywhy
    Member
    Posted 5 years ago #

  3. johnywhy
    Member
    Posted 5 years ago #

    solved:

    the problem was a conflict between my wordpress theme css and the superfish css.

    i just added !important to all the superfish css declarations, and it works like a dream.

    some may view this fix as 'overkill', or 'lazy', but i'm not out to prove to anyone that i'm a 'real' programmer, i just need my blog to work!

    read how to do it, and about the controversy here

Topic Closed

This topic has been closed to new replies.

About this Topic