snaveage
12-11-2012, 11:33 PM
1) Script Title: Step Carousel Viewer v1.9
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm
3) Describe problem: My example page: http://www.lastyling.co.uk/test/gallery.html I've set up the carousel and it works great however I'd like to center the active panel instead of it going to the left of the belt.
I've found this bit of the code in the JS file:
$currentpanel.css({float: 'none', position: 'absolute', left: paneloffset+'px'}) //position panel
which if I change paneloffset to 150px for example I can influence the panel to be centered. The problem is however that the panels I'm using are all different widths so not all the panels are being centered with a fixed measurement. The carousel width is 1010px so I think I need the code to take width of the 'active' panel and subtract that from 1010px and then divide that by 2 in order to center the content however I'm a bit of an amateur with the javascript/jquery side of things so I'm having no luck whatsoever!
Is there a way to something similar to this or will be forced to use the semi-solution I've got and use images with the same widths?
Any help you can give will be hugely appreciated!
Josh
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm
3) Describe problem: My example page: http://www.lastyling.co.uk/test/gallery.html I've set up the carousel and it works great however I'd like to center the active panel instead of it going to the left of the belt.
I've found this bit of the code in the JS file:
$currentpanel.css({float: 'none', position: 'absolute', left: paneloffset+'px'}) //position panel
which if I change paneloffset to 150px for example I can influence the panel to be centered. The problem is however that the panels I'm using are all different widths so not all the panels are being centered with a fixed measurement. The carousel width is 1010px so I think I need the code to take width of the 'active' panel and subtract that from 1010px and then divide that by 2 in order to center the content however I'm a bit of an amateur with the javascript/jquery side of things so I'm having no luck whatsoever!
Is there a way to something similar to this or will be forced to use the semi-solution I've got and use images with the same widths?
Any help you can give will be hugely appreciated!
Josh