/    Sign up×
Community /Pin to ProfileBookmark

Iframe and Parent Frame

Hi all,

I have a Iframe called sidemenu.htm containing a collapsable list. The list contains links to different urls. something like this

[B][U]company[/U][/B]
[INDENT][U]about us[/U][/INDENT]
[INDENT][U]photogallery[/U][/INDENT]
[INDENT][U]press coverage[/U][/INDENT]
[B] [U]departments[/U][/B]
[B][U]Location[/U][/B]

If I click on company, the aboutcompany.htm will open. This page also linked to same Iframe sidemenu.htm on left side of the page. So When I click on company, the same Iframe is reloaded and the collapsable list will close and Iam not able view and use sub items .

In short the collapsable list wil never open due to reloading the same iframe in the linked page.

how to solve this? please anybody guide me!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorMay 25.2005 — maybe it would have been better to put your menu in parent and pages in iframe... Well, it is possible to keep the menu open at the desired subtree, but for that we should see the script you have used to open the tree menu.
Copy linkTweet thisAlerts:
@saviauthorMay 26.2005 — <script type="text/javascript">

<!--

// expand and collapse definition lists

function dlcollapse(){

// check for necessary function

if (document.getElementsByTagName){

// grab all lists and loop through them

var lists=document.getElementsByTagName('dl');

for (var i=0;i<lists.length;i++){

// only act on lists with 'collapsable' class

if(/collapsable/.test(lists[i].className)==true){

// if they have got this far, javascript is enabled, so collapse everything

var nodelist = lists[i].childNodes;

for(var j=0;j<nodelist.length;j++){

toggleCollapse(nodelist[j]);

}

// grab all <dt>s and loop through them

var dts=lists[i].getElementsByTagName('dt');

for(var j=0;j<dts.length;j++){

// add javascript events to dynamically add/remove styles based on mouse events

dts[j].onclick=function(){

// first change the <dt>

toggleCollapse(this);

// then change all the <dd>'s until we reach the end of the list or the next <dt>

var nextSib = this.nextSibling;

while (nextSib != null){

if(nextSib.nodeType==1){ //Mozilla includes #text nodes in sibling list

if(nextSib.nodeName.toLowerCase()=="dd"){

toggleCollapse(nextSib);

}

else{

break;

}

}

nextSib = nextSib.nextSibling;

}

}

// make it obvious that they can click on <dt>'s

if(document.body.style.cursor){

dts[j].onmouseover=function(){

document.body.style.cursor="pointer";

}

dts[j].onmouseout=function(){

document.body.style.cursor="default";

}

}

}

}

}

}

}



function toggleCollapse(element){

if(/collapsed/.test(element.className)==true){

element.className = element.className.replace(/s*collapsed/,'');

}

else{

if(element.className == ""){

element.className = "collapsed";

}

else{

element.className += " collapsed";

}

}

}

window.onload = dlcollapse;

-->

</script>



this is the script used for menu collapsing!!
×

Success!

Help @savi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...