PDA

View Full Version : Step Carousel Viewer fix for Safari 2



modernhominid
02-06-2009, 11:56 PM
1) Script Title: Step Carousel Viewer

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

3) Describe problem: Syntax error in Safari 2

Viewer breaks in Safari 2, displaying panels in an unattractive, scrollable div (fine in Safari 3).

Safari 2 Javascript Console displays these errors:

SyntaxError - Parse error
[path]/stepcarousel.js
ReferenceError - Can't find variable: stepcarousel
[url of page]

Evidently, Safari 2 doesn't like how it encounters 'float' in this line:

$currentpanel.css({float: 'none', position: 'absolute', left: paneloffset+'px'}) //position panel

Declaring the styles like this instead fixes the script in Safari 2 and doesn't seem to cause errors in other browsers:

$currentpanel.css('float', 'none')
$currentpanel.css('position', 'absolute')
$currentpanel.css('left', paneloffset+'px')


Thanks for the tip go to Tony of entry 240 on http://www.gmarwaha.com/blog/?p=6