Results 1 to 5 of 5

Thread: jquery conflict

  1. #1
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default jquery conflict

    1) Script Title: jquery.magnifier.js

    2) Script URL (on DD): www.slate.zxq.net

    3) Describe problem: hi i am new to j query but very interested in how it works i understand html , css and a little java but my new project web site uses j query plugins what i have done is used the following plugins and they work fine fancybox cookie js and slideshow js everything works when i split the links and scripts up top page and bottom page (please see source www.slate.sxq.net) i have then added the magnifier js to my design and it seems to conflict with all of my other j query plugins and cancels them out... this is driving me crazy as i do think its some thing to do with the no conflict but i cant seem to get it to work i would appreciate some help please. look forward to your reply

    n

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    As with many of DD's earlier forays into jQuery, magnifier was written assuming there would be no other jQuery scripts on the page and that there might be other script libraries on the page needing the $ variable. As such, it uses the jQuery.noConflict() directive near its beginning. However, if you're a sane person running jQuery as the only javascript library and are using two or more jQuery based scripts on the page, this causes problems. Easy solution. Using a text only editor like NotePad, in jquery.magnifier.js comment out that directive as shown:

    Code:
    /* jQuery Image Magnify script v1.1
    * This notice must stay intact for usage 
    * Author: Dynamic Drive at http://www.dynamicdrive.com/
    * Visit http://www.dynamicdrive.com/ for full source code
    
    * Nov 16th, 09 (v1.1): Adds ability to dynamically apply/reapply magnify effect to an image, plus magnify to a specific width in pixels.
    * Feb 8th, 11 (v1.11): Fixed bug that caused script to not work in newever versions of jQuery (ie: v1.4.4)
    */
    
    //jQuery.noConflict()
    
    jQuery.imageMagnify={
    	dsettings: {
    		magnifyby: 3, //default increase factor of enlarged image
    		duration: 500, //default dur . . .
    Save and use that version.

    The browser cache may need to be cleared and/or the page refreshed to see changes.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi John

    thank you for your quick reply to my first ever (and not the last!) post i will have time this evening to try your theory thank you again for your help! before i forget just a quick question while we are on the subject i have three or four library's on my site and i have had to move one down to the bottom of my page (next to the body tag) to make it work is this some kind of conflict or just the way it should be or set up? your expert advice would be much appreciated.

    n

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    That would depend upon the situation on the page, quite possibly there is a conflict. If moving it there makes everything work, go with it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi john works ! thanks

Similar Threads

  1. Jquery conflict
    By ghanasyam in forum JavaScript
    Replies: 1
    Last Post: 09-13-2012, 12:50 AM
  2. Resolved Conflict jQuery
    By rexi in forum JavaScript
    Replies: 13
    Last Post: 08-30-2012, 07:40 PM
  3. Jquery Conflict
    By James Church in forum JavaScript
    Replies: 0
    Last Post: 05-24-2011, 11:20 AM
  4. jquery conflict
    By shereenm in forum JavaScript
    Replies: 0
    Last Post: 04-30-2011, 03:02 PM
  5. Conflict with jQuery?
    By Gazzab in forum JavaScript
    Replies: 1
    Last Post: 01-15-2010, 05:44 PM

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
  •