QUOTE(puaka_astro @ Feb 27 2010, 09:16 PM)
hmm.. try this
1. your image iframe named 'image_frame - <iframe name"image_frame"......
2. content iframe named - content_frame
3. link is in submenu iframe
CODE
[B]this is inside submenu[/B]
<a href="http://forum.lowyat.net/topic/1339427" onclick="changeContent('image_frame', 'http://www.google.com.my/logos/olympics10-sskating-hp.png');" target="content_frame">Link 1</a>
<script>
function changeContent(targetFrame, content) {
top.frames[targetFrame].location.href = content;
}
</script>
Perhaps my description is unclear, so you are misunderstanding me. Hmm, okay,let's explain in another way...
A B
Let's say A is a page(index.html), B is another page(equipment.html). In page A, it has a dropdown menu(I create it using the Spry Menu Bar in Dreamweaver). When I go to equipment, I can select from a list of equipments shown in the list. So, when I click on a particular equipment, it links me to page B WITH the descriptions about the selected equipment in content iframe. This is the problem that causes headache to me, but not the submenu because I have no problem to target the content to the content iframe when I click on any of the equipments in the submenu.
I hope you get what I mean.
Anyway, thank you for your help =).
Let me show you the code:
Iframe code
CODE
function dw_loadExternal(url, ifrmId, divId, bLoadMsg) {
// defaults for iframe, display div
ifrmId = ifrmId || 'buffer'; divId = divId || 'content';
if ( window.frames[ifrmId] ) {
// Could use location.replace method if you do not want back button to load previous iframe url
//window.frames[ifrmId].location.replace(url);
window.frames[ifrmId].location = url;
// If you want the whole page to scroll to the top when new content is loaded
//window.scrollTo(0,0);
var lyr = document.getElementById? document.getElementById(divId): null;
if ( lyr && bLoadMsg ) { // Option to display message while retrieving data
lyr.innerHTML = '<p>Retrieving data. Please wait ...</p>';
lyr.style.display = 'block';
}
return false;
}
return true; // other browsers follow link
}
// called onload of iframe
// displays body content of iframed doc in div
// checks for and invokes optional functions in both current document and iframed document
function dw_displayExternal(ifrmId, divId, fp) {
// defaults for iframe, display div
ifrmId = ifrmId || 'buffer'; divId = divId || 'content';
var lyr = document.getElementById? document.getElementById(divId): null;
if ( window.frames[ifrmId] && lyr ) {
lyr.innerHTML = window.frames[ifrmId].document.body.innerHTML;
lyr.style.display = 'block';
// when using with script, may have some operations to coordinate
// function in current doc or iframed doc (doOnIframedLoad)
if ( typeof fp == 'function' ) {
fp();
}
// Demonstrated in tooltip demo
if ( typeof window.frames[ifrmId].doOnIframedLoad == 'function' ) {
window.frames[ifrmId].doOnIframedLoad();
}
}
}
HTML part
CODE
/*CSS*/
#buffer { position:absolute; visibility:hidden; left:0; top:0 }
#content {
margin: 2em 1em 2em 0;
border: 0;
padding:6px 8px;
display:none; /* until loaded */
}
/*BODY*/
<a href="hidden2.html" onClick="return dw_loadExternal(this.href)">Testing</a>
<div id=content></div>
<iframe id="buffer" name="buffer" src="hidden1.html" onload="dw_displayExternal()"></iframe>
What shall I include for the link of each item in the dropdown menu so that page B will show the description of the clicked item in the content iframe?
This post has been edited by SkyW: Feb 27 2010, 11:34 PM