...

View Full Version : Custom Logo and click handlers



chris24300
10-04-2011, 02:33 PM
Hi All,

I'd like to create a custom logo (don't know what yet) that represents the pieces of my project so that a user can click on a piece of the logo and have that associated panel brought forth. I'm not sure how to go about doing this so could someone point me in the right direction?

Thanks!

xelawho
10-04-2011, 05:36 PM
img (graphic) elements can have an onclick attribute, which can be used to fire a function and that would in turn show and hide divs or other images or whatever your panels are. It's very simple and doesn't require alot of the convoluted code that you will find googling on the subject. here's some quasi code that might actually work:



<style>
.hide{
display:none;
}
</style>
<img src="logo1.jpg" onclick="showstuff('div1')">
<img src="logo2.jpg" onclick="showstuff('div2')">

<div class="hide" id="div1">Div one is here</div>
<div class="hide" id="div2">Div two is here</div>


<script type="text/javascript">
var shownDiv;
function showstuff(divID){
if (shownDiv){
document.getElementById(shownDiv).style.display="none";
}
document.getElementById(divID).style.display="block";
shownDiv=divID;
}

</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum