Click to See Complete Forum and Search --> : [RESOLVED] active state on thumbnail?


dakey
06-30-2009, 05:24 AM
Hello, i have a list of thumbnails that are created dynamically from a database which have an transparency state when the thumbnail is in the active state (ie when someone clicks on it)

I wondered is there anyway that the first one could be set to active by default when the page initially loads. My code is below:

Here is the page i am working on: http://new.harrietdewinton.com/portfolio.php

<script language="JavaScript" type="application/javascript">
<!--

function setMainImage(imageId) {
document.getElementById('main_image').src = "http://office.domain.com/images/portfolio/images/" + imageId + ".jpg";
}
</script>

<div class="portfolio-nav" id="portfolio-nav">
<ul>

<?
while ($row3=mysql_fetch_assoc($result_images)) {
print "<li><a href='#' id='thumbnail_image' onclick='setMainImage($row3[imageId])' title=''><img src='/images/tn_$row3[imageId].jpg' alt='' title='' /></a></li>";
}
?>

</ul>
<div id="next_thumbnail">
<a href="#" onclick='ajaxFunction()' title="Next" class="float-right clear-right"><strong>Next ></strong></a>
</div>
</div>


this is the css that goes with it

a:active, a:focus {
background-color: #000;
opacity:0.4;
filter:alpha(opacity=20);
}

Thanks