hey all. I’m trying to implement an image rotation but am having troubles getting the layout to work with that I need.
I’m not sure how to draw this out but I’ll try…
basically I need two columns, the left one is the one w/ the image rotation, and the right column is static.
you can see what I’m working on here:
and I put all the code on one page to make it a little easier to trouble shoot
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Image Rotator w/ Thumb</title>
<style type="text/css">
/* rotator in-page placement */
div.rotator {
position:relative;
}
/* rotator css */
div.rotator ul li {
float:left;
position:absolute;
list-style: none;
}
div.rotator ul li.show {
}
</style>
<!--Call jQuery-->
<script src="http://www.google.com/jsapi?key=ABQIAAAAKwvHZYJo6AidGiQvKf5lCRThg9PS0T6sNMTKpEnmjYPphLSv8xSH-kDwJ01qGzz4TYcLVTGhPrWLLQ" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
google.load("jquery", "1.4.2");
//]]>
</script>
<script type="text/javascript">
function theRotator() {
//Set the opacity of all images to 0
$('div.rotator ul li').css({opacity: 0.0});
//Get the first image and display it (gets set to full opacity)
$('div.rotator ul li:first').css({opacity: 1.0});
//Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
setInterval('rotate()',6000);
}
function rotate() {
//Get the first image
var current = ($('div.rotator ul li.show')? $('div.rotator ul li.show') : $('div.rotator ul li:first'));
if ( current.length == 0 ) current = $('div.rotator ul li:first');
//Get next image, when it reaches the end, rotate it back to the first image
var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div.rotator ul li:first') :current.next()) : $('div.rotator ul li:first'));
//Un-comment the 3 lines below to get the images in random order
//var sibs = current.siblings();
//var rndNum = Math.floor(Math.random() * sibs.length );
//var next = $( sibs[ rndNum ] );
//Set the fade in effect for the next image, the show class has higher z-index
next.css({opacity: 0.0})
.addClass('show')
.animate({opacity: 1.0}, 1000);
//Hide the current image
current.animate({opacity: 0.0}, 1000)
.removeClass('show');
};
$(document).ready(function() {
//Load the slideshow
theRotator();
$('div.rotator').fadeIn(1000);
$('div.rotator ul li').fadeIn(1000); // tweek for IE
});
</script>
</head>
<body>
<table>
<tr>
<td rowspan="2">
<div class="rotator">
<ul>
<li class="show"><a href="##"><img src="http://www.djprinvale.com/images/deadmau5-4x4equals12.jpg" alt="temp"/></a></li>
<li><a href="##"><img src="http://www.djprinvale.com/images/tron-legacy.jpg" alt="temp"/></a></li>
</ul>
</div>
</td>
<td><a href="##"><img src="http://www.djprinvale.com/images/diddy-lasttraintoparis.jpg" alt="temp"></a></td>
</tr>
</table>
</body>
</html>
As you can see the static image is stuck behind and not where I’m trying to get it. I’ve tried divs, tables, etc…can’t seem to get it to work.
any thoughts?