Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Jquery conflict!

    Hi!

    See here:
    http://dev.tim-spicer.com/dev.html

    PrettyPhoto was working great until I added a jquery 'slide-to-anchor' function. Now, when I visit the site in Safari, prettyPhoto stalls when loading the content.

    Any ideas?

    Many thanks

    Ben

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,918
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    I don’t know how often I’ve answered such issues already but if you had used the search you might have come across one of these answers because it’s always the same: Don’t include the jQuery library more than once in your site.

    Your code looks like this:
    Code:
    <script src="/js/04/jquery-1.6.1.min.js"></script>  
    <script src="/js/04/functions.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery.prettyPhoto.js"></script>
    You have two versions of the jQuery library there which leads to conflicts. Use the latest version and move it to the top, so that it is the first thing loaded by the browser.

  • #3
    New to the CF scene
    Join Date
    Jul 2012
    Location
    Berlin
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Several jquery libs included could be done, unfortunatelly, by external added snippets, such as widgets.

    Use "jQuery" instead of "$" and invoque the jQuery.noConflict() in the begging of your jQuery code.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,918
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    Quote Originally Posted by mimosatti View Post
    Several jquery libs included could be done, unfortunatelly, by external added snippets, such as widgets.
    If the widgets are coded properly then they aren’t doing this (or are checking before including, respectively), and if they aren’t coded properly they shouldn’t be used. However, the HTML in the OP’s link doesn’t look like an installed widget but like manually copied and pasted (as all similar issues I’ve answered here so far). The noConflict function should only be an exception and the very very last resort if nothing else is possible. Always try to avoid issues in the first place instead of superficially fixing them with more code.
    Last edited by VIPStephan; 07-15-2012 at 01:22 PM.

  • #5
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your tips!

    I'm pretty sure it actually has nothing to do with jquery; I've isolated the problem to this line of code here:

    Code:
    <a href="images/fullscreen/holder.jpg" rel="prettyPhoto[pascoe-vale]" title="GAFFNEY STREET, PACOE VALE .<br><br>...
    When I remove 'title=""' and its contents, prettyphoto loads just fine.

    Any more thoughts?

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,918
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    You can’t have HTML inside an attribute value, only text is allowed. Check your HTML and fix any possible errors.


  •  

    Tags for this Thread

    Posting Permissions

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