View Full Version : Script Not Working
onestopplay
01-19-2010, 12:16 AM
Check out this page on my site: http://www.onestopplay.com/musicvideos/
Now check out the source code. It supposed to be so that when you click on a link a certain div pops up in the "ARTISTS/SONGS" section.
Can anyone figure out why it isn't working??
THANKS!
You may have to work with it - but give this a try:
http://www.dynamicdrive.com/forums/showpost.php?p=215142&postcount=19
onestopplay
01-19-2010, 12:30 AM
That's way to confusing for me. Does anyone know what is wrong with my code? It used to work...then I don't know what happened.
Thanks Nile for the quick reply.
All you need to do is insert this:
<script type="text/javascript">
function getID(me) {
var values = document.getElementById("getValues").getElementsByTagName("div");
for(var i = 0; i < values.length; i++){
if(values[i].getAttribute("class") == me.getAttribute("id")){
values[i].style.display = "block";
} else {
values[i].style.display = "none";
}
}
}
</script>
In the head part of you're document, and on every link you have, make the ID equal to the class of which div's you want to appear.
One of you're problems is on line 2101:
}}
Remove the highlighted.
Tell me how that works out.
onestopplay
01-19-2010, 12:55 AM
I think I would really like to stay away from that method unless you can give me at least a little bit of an example for my site.
I got rid of that }. It works ... to an extent. Now when I click a song name, the video pops up (thankfully). But clicking on an artist or letter still doesn't work. Can anyone see any more errors?
id is not defined
http://www.onestopplay.com/musicvideos/
Line 145
Meaning "id" is not a variable (since the function is over). At the top of your code put:
var ida = "";
Then here:
function changeMenu(id) {
Add
ida = id;
Under function cha...() {
Then every "id" under line 145 should be "ida" instead.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.