View Full Version : JS inside of DIV tag?
dean80
03-05-2003, 04:49 PM
Okay, cg9com....you said to ask if I have problems, so I'll take you up on that offer now..
I have a problem with positioning a JS-based menu correctly. I am using DIV tags to position all of the images on the page. My problem is when I insert the the JS into the DIV that's alotted for my menu, the menu items show up, but not the sub-items beneath each one. In order to get the sub-items visible I simply just put the JS outside of any DIVs and it works, with the exception of the entire menu being flush top-left and a gaping home in the DIV for where the menu should be.
Any ideas how? I can post code if you need to look at it. Thanks!
cg9com
03-05-2003, 07:55 PM
:D
prolly best to post code, at least whats relavent.
dean80
03-05-2003, 08:04 PM
Alrighty. Here is the snippet in my stylesheet:
div.buttons {
position:absolute;
left:200px;
top:84px;
width:600px;
height:16px;
}
And here is the DIV that I'm trying to get to accept the script:
<div class="buttons">
<script language="JavaScript1.2" SRC="menu.js">
</script>
</div>
Right now I have the rest of my page set up in the same fashion since it's just images at this point. I'm rethinking that since I need to format tables, text, etc later on.
dean80
03-05-2003, 09:31 PM
Hmm... the DIV tags work with JS it seems. What my problem was that an image just below it was covering the sub-menus. I specified a z-index for that specific DIV and changed my class designations to id's and it works.
I would love to hear anyone's interpretations or comments on this. Thanks.
cg9com
03-06-2003, 01:13 AM
i had no idea why what you posted wouldnt work.
i guess there was no way for me to know about your other conflicts though. glad you cleared it up, and yea you should quadruple check your stuff, and after that check it again, lol.
neonwhiskey
03-06-2003, 04:54 PM
Dean!
Please help me, I can't get the same thing to work, been trying for a week. Could you, pretty please, send me a working example? I suspect I am trying to do exactly the same thing which you have working, now
thx
Jennifer
:rolleyes:
dean80
03-06-2003, 06:27 PM
What exactly do you need? An entire working script?
neonwhiskey
03-07-2003, 09:27 PM
I need an example of imported JS for drop-down menu, with styles in CSS, which is working. I have mine working when in the page, but not when it's in the JS file, so an entire working example would really help!
thanks,
jenn
cg9com
03-08-2003, 12:11 AM
neonwhiskey, you can check some free script sites for a menu.
also make sure that you are calling it correctly.
<script type="text/javascript" src="filename.js"></script>
and there should be no <script> tags inside the actual file.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.