Post by ?Leslie? on Aug 17, 2013 10:23:58 GMT -8
Hi everybody,
I'm currently having an issue with a code in my sidebar on The Shimmering Wand. Basically I have a bit of toggle code that allows information to drop down when you click an image. So far there is one image on my forum, which you can see at the bottom of the side bar, that will allow information to drop down below the image when clicked. This works perfectly, however....here is the tricky part. I need four images, one for each house crest, that when clicked will drop down information for that specific house. So if I clicked the Gryffindor house crest I would be able to see the information for Gryffindor...and so on and forth for each of the house shields.
I've tried a couple of things so far without any success:
First - I tried to duplicate the code and change the image...this didn't work...for two reasons: 1.) The second image was below the first image instead of beside it...and 2.) When the image was clicked, the information didn't drop down below with the information for that house, instead it activated the drop down for the first image above it.
Second - I tried to change the ToggleTarget ID to the house names to see if that would work and it made the code stop working all together...so that was a no no. Maybe this is the way to achieve what I need...but I was doing something wrong?
Third - I tried to insert a second set of information into the same bit of toggle code because I thought, for some crazy reason, that would work...and it didn't.
So I'm totally at a loss...and I'm not code savvy enough to figure this one out on my own. If perhaps somebody else knows how I might achieve this, I would greatly appreciated it.
I'm currently having an issue with a code in my sidebar on The Shimmering Wand. Basically I have a bit of toggle code that allows information to drop down when you click an image. So far there is one image on my forum, which you can see at the bottom of the side bar, that will allow information to drop down below the image when clicked. This works perfectly, however....here is the tricky part. I need four images, one for each house crest, that when clicked will drop down information for that specific house. So if I clicked the Gryffindor house crest I would be able to see the information for Gryffindor...and so on and forth for each of the house shields.
I've tried a couple of things so far without any success:
First - I tried to duplicate the code and change the image...this didn't work...for two reasons: 1.) The second image was below the first image instead of beside it...and 2.) When the image was clicked, the information didn't drop down below with the information for that house, instead it activated the drop down for the first image above it.
Second - I tried to change the ToggleTarget ID to the house names to see if that would work and it made the code stop working all together...so that was a no no. Maybe this is the way to achieve what I need...but I was doing something wrong?
Third - I tried to insert a second set of information into the same bit of toggle code because I thought, for some crazy reason, that would work...and it didn't.
So I'm totally at a loss...and I'm not code savvy enough to figure this one out on my own. If perhaps somebody else knows how I might achieve this, I would greatly appreciated it.
<style type="text/css">
#ToggleTarget {
display: none;
}
</style>
<script type="text/javascript">
function Toggle() {
var el = document.getElementById("ToggleTarget");
if (el.style.display == "block") {
el.style.display = "none";
}
else {
el.style.display = "block";
}
}
</script>
<p><a href="javascript:Toggle();"><center><img src="http://i41.tinypic.com/5b7n5y.gif"></center></a></p>
<div id="ToggleTarget">Gryffindor house information listed here!</div>