Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

databound slide out menu 2

Status
Not open for further replies.

charanch

Programmer
Jan 3, 2004
55
US
Hi there,

I don't know how to search for this and I'm Javascript challenged so hopefully somebody here can help me. I have a navigation bar with images for buttons. The site is ASP and data driven. There are three categories that have sub categories and the client wants me to create a slide out menu on mouseover of those three buttons. I have a script, but the catch is it has to pull from the categories in my database. Any thoughts, or links to point me to? Thanks in advance.

Charles Ranch
 
You'll have to use the server-side ASP to dynamically write the client-side JavaScript... a simple example:
[tt]
function SimpleThing()
{
var msg = '<%Response.Write "String from ASP" %>';

alert(msg);
}
[/tt]

Most of the heavy-lifting will need to be done by client-side code.
 
Hi Sheco,

I have managed to get your example above working onmouseover. How do I get it to display something not in an alert box and not the document.write command? Is there a way to get a table to popup? What I have to do is get a submenu to display on mouseover from an image.
Code:
onmouseover="SimpleThing()"

I have to pull from a database, loop through and all that stuff. I simply can't find anything I need on the internet or I don't know how to search for it. If you have any ideas, please let me know. Thanks for your help.
 
Well, thank you very much, DotNet. I found another one right after I posted my question to Sheco. Obviously I don't know what I'm doing trying to program this JavaScript into my ASP page, but I'm getting there. Many thanks for your help!
 
If you don't mind, could you please help me make this dynamic. My client will be adding additional galleries and I'd like to display them as he adds them but I don't know how do build the code into this script.

Code:
var menu1=new Array()
menu1[0]='<a href="?galleryid=1">Engagement</a>'
menu1[1]='<a href="?galleryid=2">Bridal</a>'
menu1[2]='<a href="?galleryid=4">Ceremony</a>'
menu1[3]='<a href="?galleryid=5">Special Features</a>'

How would I do my loop in the middle of this script? Many thanks again for your help.
 
ok something like this...code not tested...

sql = "Select ID, name from mytable"
var menu1=new Array()
Dim i
i=0
do until rsobj.EOF
menu1='<a href="?galleryid=<%=rsObj("ID")"><<%=rsObj("name")%></a>'
i=i+1
rs.MoveNext
Loop

-DNG
 
Thank you very much. I figured out how to make it work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top