Forum Moderators: mack
I have a menu for my new website design where you can choose a link to open a page. But I want these links to be opened in a iframe. Since I am horrible in english a bit, maybe a picture can tell you more of what I mean. <snip>
I am using Dreamweaver MX for the coding etc.
can someone help me out?
[edited by: Woz at 1:52 am (utc) on Mar. 31, 2003]
[edit reason] No URLs please [/edit]
function show() {
document.getElementById('frame1').src="http://www.foo.com/"
}
...
<a href="javascript:show()">This opens www.foo.com in the iframe.</a>
<iframe id="frame1">Your browser does not support iframes. Too bad for you.</iframe>
This will work for DOM compliant browsers. Older and non-compiant browsers need to be handled individually as usual...
My best advice? I know you didn't ask, but I'm going to say it anyway. WYSIWYG tools are most useful when used together with a good understanding of the underlying code.
Just give it a name or id, and use the target attribute within the <a href code.
example
<iframe name="namehere"....
<a href="linkhere.html" target="namehere">Link Text</a>