PDA

View Full Version : Step Carousel Viewer, which version of jquery?



mattastic
11-23-2012, 01:18 PM
Hi Folks,

I'm trying to use the script with a recent version of jquery, 1.8.2, but it does work. The paging buttons do not work:

http://www.mharrisweb.co.uk/scroller/

Can anyone please tell me how I can get the paging buttons to work with the latest version of jquery?

Many thanks in advance

jscheuer1
11-23-2012, 04:42 PM
Please post about Dynamic Drive Scripts in the Dynamic Drive Scripts Help section here where I've moved this thread, and:

Warning: Please include a link to the DD script(s) in question in your post. See this post (http://www.dynamicdrive.com/forums/showpost.php?p=7) for more information.

That said, this looks like a selector bug in jQuery 1.8.x or a case where the script is getting more finicky about syntax, probably the latter.

To change it to a selector that works with jQuery 1.8.x you can, using a text only editor like NotePad, open up the stepcarousel.js file and around line #220 find the highlighted line:


createpaginate:function($, config){
if (config.$paginatediv.length==1){
var $templateimg=config.$paginatediv.find('img["data-over"]:eq(0)') //reference first matching image on page
var controlpoints=[], controlsrc=[], imgarray=[], moveby=$templateimg.attr("data-moveby") || 1
var asize=(mo . . .

Change that line to:


var $templateimg=config.$paginatediv.find('img[data-over]:eq(0)') //reference first matching image on page

Save that and use that version.

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

mattastic
11-26-2012, 12:32 PM
Thanks very much for the reply.

I have changed that piece of code but now I get a error:

Error: TypeError: $ is not a function
Source File: xxxx
Line: 46


$(document).ready(function() {

Would the change I made to stepcarousel.js cause that?

jscheuer1
11-26-2012, 09:56 PM
No. And I'm getting no such error on your demo page. Likely you have other script code on some other page that you're using with this script that also uses jQuery. If so, again using a text only editor like NotePad, edit your current stepcarousel.js script, this time comment out the noConflict directive as shown (near the top):


//** Step Carousel Viewer- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm
//** Usage Terms: http://www.dynamicdrive.com/notice.htm
//** Current version 1.91 (Aug 15th, 11'): See http://www.dynamicdrive.com/dynamicindex4/stepcarouselchangelog.txt for details


//jQuery.noConflict()

var stepcarousel={
ajaxloadingmsg:

Save and use that.

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

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.