Hi guys,
I have this script for a simple slideshow below and I need the box of the slideshow to be in percentage rather then pixels. I highlighted the part where I think it should go but how do i go about in doing this>?
Thank you so much
<script type="text/javascript">
$(document).ready(function() {
var currentPosition = 0;
var slideWidth = 600;
var slides = $('.slide');
var numberOfSlides = slides.length;
var slideShowInterval;
var speed = 9000;
slideShowInterval = setInterval(changePosition, speed);
slides.wrapAll('<div id="slidesHolder"></div>')
slides.css({ 'float' : 'left' });
$('#slidesHolder').css('width', slideWidth * numberOfSlides);
function changePosition() {
if(currentPosition == numberOfSlides - 1) {
currentPosition = 0;
} else {
currentPosition++;
}
moveSlide();
}
function moveSlide() {
$('#slidesHolder')
.animate({'marginLeft' : slideWidth*(-currentPosition)});
}
});
</script><!-- Rotator script stops -->