SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript script not working on certain pages in ekmpowershop

    Hi There,

    I'm redesigning a website for a client in ekmpowershop and I've set up a small jquery script to add the class "test" to the parents of all uls that have a child containing a div with a class of .sub. This is with the purpose of adding an arrow where a dropdown menu exists.

    Now, the problem is that this is working on all pages except for the product pages, which also happen to contain a nivo slider jquery slideshow. I cannot for the life of me figure out what exactly is causing this problem but I need a solution desperately as the site is live and I'm unable to undo any changes due to the nature of ekm powershop

    Not only is this script not working, the jquery.hoverIntent.minified.js script isn't working either and again, only on the product page.

    Here's the small script:

    <script type="text/javascript">
    $(document).ready(function() {
    $("ul li .sub").parent().addClass("test");

    $("a[href='travel-accessories-51-c.asp']").attr('href', 'accessories-26-c.asp');

    });

    </script>

    Any help will of course be most appreciated!

    Thanks a lot,
    Dan
    Last edited by HAWK; Mar 30, 2011 at 02:55.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,687
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Something else has taken over the $ variable.

    Use this wrapper and you should be safe:

    Code javascript:
    jQuery(function ($) {
        // jQuery code in here can safely use $
    });
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Man you're seriously a lifesaver. I owe you one!


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •