SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru babyboy808's Avatar
    Join Date
    Nov 2004
    Location
    dublin
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Strange Issue with a slider plugin

    Hey Guys,

    I have slideshow plugin installed on a site. It works on every page apart from one and I can't figure out why.

    ​The slider is down the page a bit under the heading Screenshots.

    Here is an example of a working page

    and

    Here is an example of the page that is not working.

    Chrome inspector says it:

    Uncaught TypeError: Object [object Object] has no method 'lightBox'
    but when I view source, I see the src JavaScript files fine.

    Anybody have a few minutes to have a look?

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,358
    Mentioned
    179 Post(s)
    Tagged
    9 Thread(s)
    Hi,

    In the page that doesn't work you are including jQuery twice.

    Once in line 4
    HTML Code:
    <script type="text/javascript" src="http://www.madaboutcasinos.com/wp-content/w3tc/min/4865881c.d8fd3a.js"></script>
    and once in line 94:
    HTML Code:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
    Remove the second version and this will solve your problem.

    BTW, the reason you are seeing the error you posted is that this:
    You have minified all of your JavaScript includes with W3 Total Cache (a good idea). This Lumps all of the minified JavaScript into one file.
    So, within this file, you first load jQuery, then you load the lightbox plugin which adds the lightbox method to the $ function.
    Then you load the second version of jQuery, which replaces the $ function - and the lightbox method with it.

  3. #3
    SitePoint Guru babyboy808's Avatar
    Join Date
    Nov 2004
    Location
    dublin
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pullo, thanks a million mate! Solved it perfectly.


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
  •