• Resolved crobley

    (@crobley)


    I have the plugin Q and A which uses jQuery to open up a question and reveal the answer. Works great until I added some new code to the FOOTER of my wordpress site.

    <script type="text/javascript">
    	jQuery('body').html(
        	function(i,h){
            	return i.replace(/(StrongFirst)/g,'<span class="strongfirst">$1?</span>');
        });
    </script>

    This looks for any instance of the name StrongFirst (the company name) and applies a style to it. Works great on its own as well.

    With both of them active the Q and A plugin when you click a question will open and then immediately close right away (as opposed to staying open like it should). When I remove this code it works great.

    Is this a conflict with jQuery or something?

Viewing 1 replies (of 1 total)
  • Thread Starter crobley

    (@crobley)

    After racking my brain for an hour I figured it out. I simply moved the jQuery code above this line in the footer:

    <?php
    	/* Always have wp_footer() just before the closing </body>
    	 * tag of your theme, or you will break many plugins, which
    	 * generally use this hook to reference JavaScript files.
    	 */
    
    	wp_footer();
    ?>

    Works great now.

Viewing 1 replies (of 1 total)
  • The topic ‘jQuery conflict with Q and A Plugin’ is closed to new replies.