javascript ?
- Started
- Last post
- 12 Responses
- Gooners
Kind of a newbie, but was wondering if anyone could help me with some javascript code or know of any good references. Trying to make a collapse and expand menu, but when one button expands I want the other to automatically collapse, so there is only one menu expanded at a time. Can anyone help me?
- 7340
function togg(num) {
var fullpath='sub' + num;
var text=document.getElementById(ful...
for (i=1; i<11; i++) {
if(text.style.display!='block'){
var forpath ='sub' + i;
if(document.getElementById(forpa... {
document.getElementById(forpath...
}
}
}
if(text.style.display != 'block') {
text.style.display='block';
}
else{text.style.display = 'none';
}
}every div i have is id'ed sub1, sub2, etc... sub10 (hence the "i<11")
- 7340
and heres the code for the "a" tag
<a href="javascript:togg('1');">
again from 1, 2 ... 10
hope that helps
- stupidresponse0
jQuery
- mrdobolina0
while we are at it, does anyone have an age verification script like breweries use? The one I have works tits, except in IE7. kthxbye
- 7340
hey stupid,
(sorry it amused me to write that)
do you have any good links to online explainations /tutorials for jQuery because i'm interested to look into it. yeah i'm a little behind- some good ones here:
http://15daysofjquer…stupidresponse - more:
http://www.learningj…stupidresponse - appreciated! thanks734
- some good ones here:
- eb60
734,
I have no js knowledge. I tried to do what you suggested above. What am I doing wrong?
- eb60
I added everything into the html file so you can see it.
- 7340
i think i found your problems... qbn has cropped the code
- Gooners0
sorry this is becoming a tutorial or something, this will teach you not to deal with newbies, jk, i appreciate it and this would really be helpful if I could get this to work
- don't mind helping. little slow at work and i know how frustrating it can be when you can't get something to work simply.734