CassidyHunt
IS-IT--Management
I have a list of thumbnails that I am trying to get to work in filmstrip style without using frames. I almost have it but I do not know how to fix this last issue.
Here is the code:
This scrolls but instead of scrolling the contents in the DIV it expands the DIV and never reveals the images that are in teh overflow hidden portion.
Thanks
Cassidy
Here is the code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<br />
<table>
<tr>
<td><input type="button" value="<<" onmousedown='leftScroll()' /></td>
<td>
<script type="text/javascript" >
// gets the applied value for the specified styleProp on element.
function getStyle(element,styleProp)
{
if (window.getComputedStyle) var y = window.getComputedStyle(element,null).getPropertyValue(styleProp);
else if (element.currentStyle) var y = element.currentStyle.getAttribute(styleProp);
return y;
}
var timer = null;
function init()
{
document.body.parentNode.onmouseup = cancelTimer;
}
function cancelTimer()
{
if (timer) clearTimeout(timer);
}
function leftScroll(e)
{
var scrollDiv = document.getElementById('clhPicture_pictures');
if (!scrollDiv.style.setProperty)
{
var currentPos = (isNaN(parseInt(scrollDiv.currentStyle.marginLeft) * 1) ? 0 : parseInt(scrollDiv.currentStyle.marginLeft));
scrollDiv.style.marginLeft = currentPos - 1;
}
else
{
var leftMargin = parseInt(getStyle(scrollDiv, 'margin-left'));
scrollDiv.style.setProperty('margin-left', leftMargin - 1, null);
}
timer = setTimeout('leftScroll()', 30);
}
function rightScroll(e)
{
var scrollDiv = document.getElementById('clhPicture_pictures');
if (!scrollDiv.style.setProperty)
{
var currentPos = (isNaN(parseInt(scrollDiv.currentStyle.marginLeft) * 1) ? 0 : parseInt(scrollDiv.currentStyle.marginLeft));
scrollDiv.style.marginLeft = currentPos + 1;
}
else
{
var leftMargin = parseInt(getStyle(scrollDiv, 'margin-left'));
scrollDiv.style.setProperty('margin-left', leftMargin + 1, null);
}
timer = setTimeout('rightScroll()', 30);
}
window.onload = init;
</script>
<div id="clhPicture_container" style="width:200px;Height:72px;">
<div id="clhPicture_pictures" style="overflow:hidden;width:200px;Height:72px;">
<table style="width: 600px; border-spacing: 0px; border-collapse: collapse;" cellpadding="0" cellspacing="0">
<tr>
<td style=' cursor:pointer; width: 100px;height: 72px;background-image: url(Images/CassLookinggood.jpg); background-repeat: no-repeat;'><a href="Images/CassLookinggood.jpg"> </a></td>
<td style=' cursor:pointer; width: 100px;height: 72px;background-image: url(Images/Cass_Korb.jpg); background-repeat: no-repeat;'><a href="Images/Cass_Korb.jpg"> </a></td>
<td style=' cursor:pointer; width: 100px;height: 72px;background-image: url(Images/desilookinggood.jpg); background-repeat: no-repeat;'><a href="Images/desilookinggood.jpg"> </a></td>
<td style=' cursor:pointer; width: 100px;height: 72px;background-image: url(Images/desi_fish.jpg); background-repeat: no-repeat;'><a href="Images/desi_fish.jpg"> </a></td>
<td style=' cursor:pointer; width: 100px;height: 72px;background-image: url(Images/korbo_8m.jpg); background-repeat: no-repeat;'><a href="Images/korbo_8m.jpg"> </a></td>
<td style=' cursor:pointer; width: 100px;height: 72px;background-image: url(Images/Korbo_Novemeber.jpg); background-repeat: no-repeat;'><a href="Images/Korbo_Novemeber.jpg"> </a></td>
<td style=' cursor:pointer; width: 100px;height: 72px;background-image: url(Images/sambigsmile.jpg); background-repeat: no-repeat;'><a href="Images/sambigsmile.jpg"> </a></td>
<td style=' cursor:pointer; width: 100px;height: 72px;background-image: url(Images/sam_video_game.jpg); background-repeat: no-repeat;'><a href="Images/sam_video_game.jpg"> </a></td>
<td style=' cursor:pointer; width: 100px;height: 72px;background-image: url(Images/sam_wild.jpg); background-repeat: no-repeat;'><a href="Images/sam_wild.jpg"> </a></td>
</tr>
</table>
</div>
</div></td>
<td><input type="button" value=">>" onmousedown='rightScroll()' /></td>
</tr>
</table>
</form>
</body>
</html>
This scrolls but instead of scrolling the contents in the DIV it expands the DIV and never reveals the images that are in teh overflow hidden portion.
Thanks
Cassidy