Results 1 to 4 of 4

Thread: Step Carousel does not work with noConflict

  1. #1
    Join Date
    Jul 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Step Carousel does not work with noConflict

    1) Script Title:
    Step Carousel Viewer v1.6.1

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...epcarousel.htm

    3) Describe problem:
    When I use JQuery's noconflict() I get a javascript error with Step Carousel Viewer v1.6.1. I have to do a jQuery.noConflict(); to fix conflicting issue with other scripts (like using prototype.js at the same time).

    For example this causes a javascript error and stops the carousel from working (the right/left arrows don't show to scroll through the images):
    <script type="text/javascript" src="scripts/jquery126.js"></script>
    <script type="text/javascript"> var $j = jQuery.noConflict(); </script>
    <script type="text/javascript" src="scripts/stepcarousel.js"></script>

    Removing "<script type="text/javascript"> var $j = jQuery.noConflict(); </script>" would fix it.

    Please help
    kenw232@yahoo.com

  2. #2
    Join Date
    Aug 2004
    Posts
    9,918
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Having called $j = jQuery.noConflict(), the fastest way to complete the change is to open up stepcarousel.js, and do a search and replace of all instances of "$" with "$j" instead.
    DD Admin

  3. #3
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Another saolution to noConflict()

    I just added 2 lines to step carousel v1.6.1 and worked fine with jQuery.noConflict().

    Code:
    addnavbuttons:function(config, currentpanel){
    	(function ($){ // Added for noConflict()
    		config.$leftnavbutton=$('<img src="'+config.defaultbuttons.leftnav[0]+'">').css({zIndex:50, position:'absolute', left:config.offsets.left+config.defaultbuttons.leftnav[1]+'px', top:config.offsets.top+config.defaultbuttons.leftnav[2]+'px', cursor:'hand', cursor:'pointer'}).attr({title:'Back '+config.defaultbuttons.moveby+' panels'}).appendTo('body')
    		config.$rightnavbutton=$('<img src="'+config.defaultbuttons.rightnav[0]+'">').css({zIndex:50, position:'absolute', left:config.offsets.left+config.$gallery.get(0).offsetWidth+config.defaultbuttons.rightnav[1]+'px', top:config.offsets.top+config.defaultbuttons.rightnav[2]+'px', cursor:'hand', cursor:'pointer'}).attr({title:'Forward '+config.defaultbuttons.moveby+' panels'}).appendTo('body')
    		config.$leftnavbutton.bind('click', function(){ //assign nav button event handlers
    			stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby)
    		})
    		config.$rightnavbutton.bind('click', function(){ //assign nav button event handlers
    			stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby)
    		})
    		if (config.panelbehavior.wraparound==false){ //if carousel viewer should stop at first or last panel (instead of wrap back or forth)
    			this.fadebuttons(config, currentpanel)
    		}
    		return config.$leftnavbutton.add(config.$rightnavbutton)
    	})(jQuery); // Added for noConflict()
    },

  4. #4
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    If only I would have come to the forums 2 hours earlier today! Thanks Kozawa for the fix!

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
  •