View Full Version : DHTML + iframes?

09-06-2005, 02:07 AM
I have a menu bar on my site (pk.darkuniverse.net) i'd like to beable for all the links in the menu to beable to be displayed within a iframe is there away to do this?

So like anytime someone clicks on one of the links (that is sopsot to display within the iframe) instead of it linkng to the page it will open in the iframe on the site.

the code im using for my site i don't have the iframe stuff yet because i don't know if what i want to do will work with this. thats within a javascript file i have on the site.

// ssmItems[...]=[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank

to make a header
ssmItems[0]=["Menu"] //create header
ssmItems[1]=["Forums", "http://pk.darkuniverse.net/Forums",""]
ssmItems[2]=["Information", "http://pk.darkuniverse.net/info.htm",""]
ssmItems[3]=["Not finished", "http://pk.darkuniverse.net", ""]
ssmItems[4]=["Not finished", "http://pk.darkuniverse.net", ""]
ssmItems[5]=["Not Finished", "http://pk.darkuniverse.net", ""]
ssmItems[6]=["Not finished", "http://pk.darkuniverse.net", ""]

ssmItems[7]=["Not finished", "http://pk.darkuniverse.net", "", 1, "no"] //create two column

ssmItems[8]=["Not finished", "http://pk.darkuniverse.net", "",1]

ssmItems[9]=["External Links", "", ""] //create header
ssmItems[10]=["Not finished", "http://pk.darkuniverse.net", ""]
ssmItems[11]=["not finished", "http://pk.darkuniverse.net", ""]
ssmItems[12]=["Not finished", "http://pk.darkuniverse.net", ""]



this right here is the actual code in the html document that is displayed on the site.

<style type="text/css">
A.ssmItems:link {color:black;text-decoration:none;}
A.ssmItems:hover {color:black;text-decoration:none;}
A.ssmItems:active {color:black;text-decoration:none;}
A.ssmItems:visited {color:black;text-decoration:none;}

<SCRIPT SRC="ssm.js" language="JavaScript1.2">

//Dynamic-FX slide in menu v6.5 (By maXimus, http://maximus.ravecore.com/)
//Updated July 8th, 03' for doctype bug
//For full source, and 100's more DHTML scripts, visit http://www.dynamicdrive.com


<SCRIPT SRC="ssmItems.js" language="JavaScript1.2"></SCRIPT>

09-06-2005, 04:30 AM
Give the iframe a name like:

<iframe name="main" src="some.htm"></iframe>Then use that name as the target value in the code:

ssmItems[1]=["Forums", "http://pk.darkuniverse.net/Forums","main"]

09-06-2005, 05:12 AM
Alright thanks works like a charm =)

09-06-2005, 05:13 AM
Works here.