/    Sign up×
Community /Pin to ProfileBookmark

Frame resizing/collapsing script needed !

Hello all !

I need badly a frame resizing/collapsing script [B]that works under Netscape 6.[/B]

I’d like something similar to Dynamic’s drive script ([URL=http://www.dynamicdrive.com/dynamicindex8/collapsemain.htm]Link[/URL]).

I didn’t found any working script for Netscape so far and only Microsoft seemed to have managed it. If you go for example under the MSDN section, you’ll see that it will work for Netscape (but it seems to reload all the frame !) : ([URL=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/VBRef98/html/vbsamppage.asp]Link[/URL]). Unfortunately, i am not able to grab and make that microsoft script work !!!

Anyone knows how to acomplish that or knows a tricks that would almost do the same thing ?

Many thanks !

to post a comment
JavaScript

36 Comments(s)

Copy linkTweet thisAlerts:
@JonaMay 12.2003 — Try giving the left frame an ID and the source of the left frame, onDblClick call the function.
Copy linkTweet thisAlerts:
@MotaboboauthorMay 12.2003 — Do you mean using the name tag ?

If so, i've already tried that but maybe i did something wrong ?
Copy linkTweet thisAlerts:
@JonaMay 12.2003 — Try using (in the frameset page) document.getElementsByTagName("framset")[0]

(For example, on the function of that one page, use document.getElementsByTagName("frameset")[0][b].cols[/b] for the [i]if[/i] statement.)
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — Sorry for being such an ass but it doesn't seem to work ! (i really don't know sh*t about javascript)

Here is what i used :

On the mainframe (containing the frameset :


<html>

<head>

<title>Frame Set Example</title>

<script language="JavaScript1.2">

/*

Collapsible Left Frame Script-

© Dynamic Drive (www.dynamicdrive.com)

For full source code, installation instructions,

100's more free DHTML scripts, and Terms Of

Use, visit dynamicdrive.com

*
/

defaultconf=''

function expandf(){

if (document.all){

if ([B]document.getElementsByTagName("frameset")[0].cols[/B]!="10,*")

[B]document.getElementsByTagName("frameset")[0].cols[/B] ="10,*
"

else

[B]document.getElementsByTagName("frameset")[0].cols[/B] =defaultconf

}

}

</script>

</head>

<frameset BORDER="10" BORDERCOLOR="#6699CC" cols="53%,47%">

<noframes>

<body>

<p>You must use a browser that can display frames to see this page.</p>

</body>

</noframes>

<frame NAME="exampletoc" scrolling="auto" src="left.htm" [B]id="frameset"[/B] >

<frame NAME="examplecontent" scrolling="auto" src="right.htm">

</frameset>

</html>


Here is what i use in the leftframe :


<script language="JavaScript1.2">

/*

Collapsible Left Frame Script-

© Dynamic Drive (www.dynamicdrive.com)

For full source code, installation instructions,

100's more free DHTML scripts, and Terms Of

Use, visit dynamicdrive.com

*
/

if (document.all)

window.parent.defaultconf=window.parent.[B]document.getElementsByTagName("frameset")[0].cols[/B]

function expando(){

window.parent.expandf()

}

document.ondblclick=expando[B]()[/B]

</script>


===========================================


The original script is :


<script language="JavaScript1.2">

/*

Collapsible Left Frame Script-

© Dynamic Drive (www.dynamicdrive.com)

For full source code, installation instructions,

100's more free DHTML scripts, and Terms Of

Use, visit dynamicdrive.com

*
/


defaultconf=''

function expandf(){

if (document.all){

if ([B]document.body.cols[/B] !="10,*")

[B]document.body.cols[/B] ="10,*
"

else

[B]document.body.cols[/B] =defaultconf

}

}

</script>


and :


<script language="JavaScript1.2">

/*

Collapsible Left Frame Script-

© Dynamic Drive (www.dynamicdrive.com)

For full source code, installation instructions,

100's more free DHTML scripts, and Terms Of

Use, visit dynamicdrive.com

*
/

if (document.all)

window.parent.defaultconf=window.parent.[B]document.body.cols[/B]

function expando(){

window.parent.expandf()

}

document.ondblclick=expando

</script>
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — This line: if (document.all){ and its corresponding bracket (at the end that closes the if statement) should be removed. NS6 completely ignores this function because it says, "if(document.all)" and NS6 does not recognize document.all like IE does. Hope that helped a little. ?
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — Hello again !

I removed what you said but it does an inifinite loop for some reason + it doesn't work under IE. I don't mind writing a totally different code for both browsers, but i only want one script that will work under Netscape 6.

Could you write (in fact almost copy/paste) the correct code for both the frameset and the left frame ?? Because i think it only involves a couple of lines...Please ?

Or i could attached a zip file with the files ?

Tell me what you think !
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — I have one problem, which is the reason I cannot fix this script for you so fast: I do not have NS6! So I can't test anything on my own. :eek: I'll have to download it, but now the problem is: I have to buy a new hard drive for my computer first! :eek::eek:
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — Ohhh i see,

I don't mind testing your solutions at all since you can't but it may take more time unless you have a working solution right away.

I don't mind if it takes more time also, it depends on you !

I think that if you just retype your solution here i could paste it in my pages and see if it works...and tell you if it did or not.

How about that ?

Thanks !
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — Well, I'll look and see if I can find a download from Netscape for it.. I'll have barely any room left on my harddisk, but I guess it's worth it... ?
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — Wait... Where can I download the full version of Netscape 6? I can't download it from Netscape's site, because it keeps redirecting to NN7! Not even the FTP site has it! ? I even tried download.com.com, and they have it, but the download is from Netscape's site (which [i]doesn't[/i] have it). Do you know where I could download it?
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — Wait, I found it a http://sillydog.org/narchive/ it's at 50% now.
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — Cool :-)

Here is the link :

[URL=http://wp.netscape.com/download/archive.html]http://wp.netscape.com/download/archive.html[/URL]

For my tests i use the first version of Netscape 6, that is 6.1 english :

[URL=http://ftp.netscape.com/pub/netscape6/english/6.1/windows/win32/sea/N6SetupB.exe]Download link (you can right-click)[/URL]

Thank you !

Tell me if this works for you !
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — I tried that, it didn't work for me (wonder why). I got it though. Can you upload the files in a .zip format so I can take a look, please?
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — Never mind, take a look at the attached .zip file. It works in NS6.2. But now it doesn't work in IE. I will fix that later. :p You could probably figure that out on your own, though, eh? ?

[upl-file uuid=00245ddf-decd-4b79-befb-f8a9b43a3e32 size=831B]collapse_fset.zip[/upl-file]
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — Awesome !

I can't wait to get home to try it !!!!

Well, i'll let you know when i get back home !

Thanks in advance !!!
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — I got it to work in IE, too.

[upl-file uuid=6c83c977-3ad0-4dee-b44c-761938443a12 size=897B]collapse_fset.zip[/upl-file]
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — You're the man !!!!

Awesome :eek:

You should really submit your script to Dynamic Drive or some other javascript site.

I have browse the entire web for a script like this one !

Many thanks ?
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — You know what? I think I will. ?
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — You know, if you want any other idea for totally new submissions like this one for some javascript sites, i have plenty of ideas (or if you want, scripts i want that are not on the net yet !)

LOL

Thanks again & good work !

By the way, do you know if it would be possible to store in a cookie (for both NN & IE of course) if a user has collapse the left frame or not ?
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — I'd [i]love[/i] some ideas! lol And yes, you can store whether the frame is collapsed or not in a cookie (but you don't [i]really[/i] want that, do you? lol).
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — Well, i'm suggesting it so you can develop the coolest collapsing left frame script out there !!!


Maybe i want it badly...after all :rolleyes:
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — All right... :rolleyes: Consider it done within 24 hours. (I have some work I have to catch up on, so I won't be on for a while.) Also, you said you had lots of ideas that weren't on the Net yet, etc., etc., well, could you please suggest 'em? Or PM me, either one is fine. ?

Talk to ya later...
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — I sure will ?

Thank you so much !
Copy linkTweet thisAlerts:
@brendandonhueMay 13.2003 — Please post/PM them for me too, I am not advanced at JS, but I am learning and having a goal of some sort would definitely help in the learning process ?
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — LOL should i start a new thread or what =)

I have also a couple of ASP undone things.

I will come up tomorrow with some ideas.
Copy linkTweet thisAlerts:
@JonaMay 13.2003 — Whoa! ASP isn't my field. lol I can do PHP and Perl, but ASP is a completely new concept for me. ?
Copy linkTweet thisAlerts:
@MotaboboauthorMay 13.2003 — Don't worry i have plenty of javascript questions hehe ?
Copy linkTweet thisAlerts:
@MotaboboauthorMay 14.2003 — Before you wrote your code, i was using ths script here (do i have to mention that it wasn't working under NN6 ?) :

<SCRIPT language=javascript 1.2>

var strUrl_Active = "";

var strColumns_Current = "175,*";

var strColumns_hidden = "10,*
";

//--------------------------------------------

function manageSubtoc()

//--------------------------------------------

{

strColumns_Active = top.content.zone1.frameSubS.cols;

if (strColumns_Active == strColumns_hidden)

{

// Expand menu

document.all.imgHideSubToc.src = "images/hidesubtoc/hidetoc2.gif";

document.all.imgHideSubToc.title = "Close the menu";

top.content.zone1.frameSubS.cols = strColumns_Current;

top.content.zone1.frameSubSLeft.fraSubDeeptree.location.href = strUrl_Active;

}

else

{

// Hide menu

document.all.imgHideSubToc.src = "images/hidesubtoc/closetoc2.gif";

document.all.imgHideSubToc.title = "Open the menu";

top.content.zone1.frameSubS.cols = strColumns_hidden;

strUrl_Active = top.content.zone1.frameSubSLeft.fraSubDeeptree.document.URL;

top.content.zone1.frameSubSLeft.fraSubDeeptree.location.href = "hidesubtoc.asp";

}

}

</SCRIPT>


--------------------------------------------------------------------

I think there is nice features there that you could implement too that is:

1-hidding the left frame by replacing it with another blank page once the left frame is collapsed. Of course, it should put back on the original page as soon as the frame would be reloaded to it's original position.

2-When the left frame is open there is this little "X" pic just like the one in the upper right corner of your default windows to collapse the frame (instead of dblclick). Once the frame is collapsed, that image is "replaced" (in the javascript) by another pic that restore the original position of the left frame. Notice that there was also an onmouseover description over the pics : document.all.imgHideSubToc.title

3-Of course, this script too miss the cookie implementation.


The images that closed/opened the frame on the above script were on a different frame than the collapsing left frame. I think it'd be better if those images were in the same frame that the one that collapse.

This would be really neat ?

Unfortunetly, this source is on my employer's company intranet and i can't show an example here but there is a similar thing on msdn website :

[URL=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/VBRef98/html/vbsamppage.asp]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/VBRef98/html/vbsamppage.asp[/URL]

The only difference is again that the closing pic and the reload pic is on different frames !
Copy linkTweet thisAlerts:
@MotaboboauthorMay 14.2003 — Maybe it would be better to do like Microsoft ?

That is put the close image on the collapsing frame and once it collapsed to 0 (so we don't see any content of the left frame), it writes a reload image one the upper frame...

What is best do you think ?
Copy linkTweet thisAlerts:
@JonaMay 14.2003 — Hmmm... So, if I'm getting this right, it should be cross-browser compatible, saves preferences to a cookie, synchronization for a left TOC/Navigation frame, and resizes the left frame to visible/invisible accordingly. Now my question is, where does this "image reloading" come into place?
Copy linkTweet thisAlerts:
@MotaboboauthorMay 14.2003 — Yes you understood right !

Now i need the image to change from an X to another pic (once the left frame is collapsed and if both pics are on the same frame as the collapsing frame). That new pic would reload the left frame at it's original position. Once the frame is back at his original position, the X pic re-appear and the other one disappear and etc... I say if both pics are on the same frame as the collapsing one because if we use the Microsoft solution, i only need one pic on the left frame and another one that shows up on another frame only when the left frame is collapsed.

Now Microsoft has develop a script where the X pic is on the collapsing frame while the reload pic appear only on the upper frame when the left frame is collapsed.

Now i was wondering which one is better ?
Copy linkTweet thisAlerts:
@JonaMay 14.2003 — The first one looks more complex..... And better. lol I think we should go with the first one. Unless I'm half-way through and realize that MS's way would be better... So we'll see. So, what're we gonna start with? The already-existent cross-browser compatible script that collapses/resizes the left frame and saves it to a cookie? Or what? ?
Copy linkTweet thisAlerts:
@MotaboboauthorMay 14.2003 — Hmmm, you the expert so you tell me !

I wish i could help you on that one lol

I think the order doesn't matter here as long as the final source works LOL

I have an opinion though...If both pics are on the same frame that means that we will have to hide in some way the content of the left frame (so i don't see the tables,etc..) while leaving enough space for the reload pic. The way for doing this would be to load another page....The old script i was using does that but there is a bug (+ it doesn't work on NN). Once the blank page is loaded and you resize the left frame, you can't bring the original page back !!! It's always the blank page !
Copy linkTweet thisAlerts:
@JonaMay 14.2003 — Hmmm..... I see. So basically we're going to add (a lot) to the script I just made for ya? I'll look over the code you posted that works only in IE and kinda' merge 'em (but make it work in NS6) together.... I'm extremely busy today, so it might take a while. lol But that's okay, right? ?
Copy linkTweet thisAlerts:
@MotaboboauthorMay 14.2003 — LOL it's more than OK.

I'm not in a hurry, i'm just glad you can help me ?
Copy linkTweet thisAlerts:
@JonaMay 14.2003 — OK, cool. Because I have some chores and stuff I need to do. :eek: So I'll catch you later. BTW, do you have an IM programs?
×

Success!

Help @Motabobo 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.19,
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,
)...