• Hey Guys, I’m a web designer that likes to pretend that I know how to code a little bit. I’m working on a new website, and have a few jQuery scripts (written by others) that are being combined into a WordPress site.

    I had all of the jQuery working locally in plain old HTML designs, but when I put it all online and started using WordPress for templating, some of them stopped working.

    Wondering if anyone could be any help?

    Specifically:

    https://www.cmsdesignresource.com/section/cms-list/
    This page should have mouseover events on the list of cms’s. (Light grey background should become darker grey) using bigtarget.js

    It should also have custom checkboxes that should appear when you click on “use our content management system finder” using prettyCheckboxes.js

    https://www.cmsdesignresource.com/cms-list/wordpress/
    This page should do a lightbox-like effect when you click on “View Screenshots” using the fancybox.js

    I know it has something to do with conflicts between the scripts and WordPress, but I’m not sure how to alleviate these? Any bit of help would be greatly appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • This are quite common lately, try add this on your page header

    <script type="text/javascript">
    if (typeof jQuery == "function") { jQuery.noConflict(); }
    </script>

    Then replace all your scripts that used the dollar sign “$” ie

    from
    [...] $(this).each(function(){ [...]
    to
    jQuery(this).each(function(){
    ...

    Thread Starter thejester12

    (@thejester12)

    Do I need to replace the dollar sign $ just within my “configuration” javascript that’s found directly on the page? Or even the embedded scripts?

    Like, for this one example: Within this file would I change every instance of a dollar sign?

    Seems like doing that would screw up sections like this:

    $a.parents(o.clickZone)
    				.hover(function() {
    					$h = $(this);
    					$h.toggleClass(o.hoverClass);
    					if(typeof o.title != 'undefined' && o.title === true && title != '') {
    						$h.attr('title',title);
    					}

    It depend with scripts global scope if it within jQuery function/class its fine, but to make it safe try change all dollar sign that has parentheses and dotted like “$(),$(this)” and “$.,$.each,$.cookie” and not “$H ” or “$a” .

    btw do u have firefox firebug?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘jQuery Help with WordPress Theme’ is closed to new replies.