PDA

View Full Version : Script Error in IE - Button Positioning



Cactii
02-20-2009, 06:33 AM
1) Script Title: Step Carousel Viewer v1.4

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm

3) Describe problem:

I've set up this script on the domain twice[nospacehere]bright[dot]com and it works well.

In Firefox, Opera and in Safari everything is beautiful. In IE, of course, it's not. The script works but there is a Javascript error that I have tracked down to the buttons.

First of all let me say that passing the positioning of the buttons did not work so well for this layout on this page so I went into the script and manually positioned them.

I changed these two lines in the script. They're recognizably the two lines of code for positioning the buttons.

<code>
config.jQueryleftnavbutton=jQuery('<img src="'+config.defaultbuttons.leftnav[0]+'">').css({zIndex:50, position:'absolute', left:'6px', top:'60px', cursor:'hand', cursor:'pointer'}).attr({title:'Back '+config.defaultbuttons.moveby+' panels'}).appendTo('#carousel')
config.jQueryrightnavbutton=jQuery('<img src="'+config.defaultbuttons.rightnav[0]+'">').css({zIndex:50, position:'absolute', left:'380px', top:'60px', cursor:'hand', cursor:'pointer'}).attr({title:'Forward '+config.defaultbuttons.moveby+' panels'}).appendTo('#carousel')
</code>

Without it being done this way the buttons do not ever show up on the page. If I do it this way the buttons show up but I get a vague error from IE.

I tried with v 1.6.1 of the script and neither way would allow me to have buttons so that is why I'm using the 1.4 version.

As a side note... I am also using Multibox which uses jQuery and am using the jQuery.NoConflict() statement in the code.

I hope that someone out there can see what is wrong.

ddadmin
02-20-2009, 08:10 PM
Please post a link to the page on your site that contains the problematic script so we can check it out.

Cactii
02-20-2009, 08:19 PM
I did actually... I just don't want it coming up in search results...

http://www.twicebright.com

ddadmin
02-21-2009, 06:27 AM
Are you sure the error is due to the change you had made above? That is, if you revert:


config.jQueryleftnavbutton=jQuery('<img src="'+config.defaultbuttons.leftnav[0]+'">').css({zIndex:50, position:'absolute', left:'6px', top:'60px', cursor:'hand', cursor:'pointer'}).attr({title:'Back '+config.defaultbuttons.moveby+' panels'}).appendTo('#carousel')
config.jQueryrightnavbutton=jQuery('<img src="'+config.defaultbuttons.rightnav[0]+'">').css({zIndex:50, position:'absolute', left:'380px', top:'60px', cursor:'hand', cursor:'pointer'}).attr({title:'Forward '+config.defaultbuttons.moveby+' panels'}).appendTo('#carousel')

back to the original code chunk, the error in IE disappears? Doing a side by side comparision, it seems the main change you made was just to replace all occurrences of $ with jQuery. Try replacing the following line in your code:


this.addnavbuttons(config, config.currentpanel)

to:


var $navbuttons=this.addnavbuttons(config, config.currentpanel)

BTW, please note that your page is currently in violation of our usage terms, since the credit notice doesn't appear inline on the page. Please reinstate the credit notice: http://www.dynamicdrive.com/notice.htm