Save frameset heights in a cookie and restore next session?

To finish your collection (you've already created a function to adjust the rows): function getTopRows(){ var rows = ; var main = $("#myframeset", top. Document); //Get the whole height of the main var wholeheight = $(main).height(); //Calculate the relative height of each frame (child) of the main main.children(). Each(function(){ rows.

Push(Math. Round(100*$(this).height()/wholeheight)); }); rows = rows. Join("%,")+"%"; //Example: 6%,87%,6% return rows; } Calling getTopRows() returns a string of relative units, which can be used to set the top rows.

This value can be saved by using the JQuery cookie plugin: You can add this function as an event listener to a button function saveTopRows(){ var topRows = getTopRows(); $. Cookie("rows", topRows); //Save data } //Execute on load of the page: (function(){//Anonymous wrapper to prevent leaking variables var rows = $. Cookie("rows"); if(rows) $("#myframeset", top.

Document). Attr("rows", rows); })() Don't forget to add the JQuery cookie plugin, either by defining it in the source, or by adding an external JS file. See the JQuery website for the source of the Cookie plugin.

After downloading the source, save it as "jquery.cookie. Js", and add this code: script src="jquery.cookie. Js"> function getTopRows(){ //Rest of code.

To finish your collection (you've already created a function to adjust the rows): function getTopRows(){ var rows = ; var main = $("#myframeset", top. Document); //Get the whole height of the main var wholeheight = $(main).height(); //Calculate the relative height of each frame (child) of the main main.children(). Each(function(){ rows.

Push(Math. Round(100*$(this).height()/wholeheight)); }); rows = rows. Join("%,")+"%"; //Example: 6%,87%,6% return rows; } Calling getTopRows() returns a string of relative units, which can be used to set the top rows.

This value can be saved by using the JQuery cookie plugin: //You can add this function as an event listener to a button function saveTopRows(){ var topRows = getTopRows(); $. Cookie("rows", topRows); //Save data } //Execute on load of the page: (function(){//Anonymous wrapper to prevent leaking variables var rows = $. Cookie("rows"); if(rows) $("#myframeset", top.

Document). Attr("rows", rows); })(); Don't forget to add the JQuery cookie plugin, either by defining it in the source, or by adding an external JS file. See the JQuery website for the source of the Cookie plugin.

After downloading the source, save it as "jquery.cookie. Js", and add this code: ... function getTopRows(){ //Rest of code.

Greatly helpful.. the only glitch was that it seemed a little slow on some browsers so I moved it into the frameset file itself... and it runs there pretty much as you wrote it.. thanks much – stebbin45 Oct 7 at 7:08 That's not a "glitch". That's a "The framed page hasn't loaded yet" ;) – Rob W Oct 7 at 7:13.

Use the jQuery cookie plugin, and do something like this: $(window). Unload(function() { var myrows = // get the stuff you need $. Cookie("mycookie", myrows, { expires: 10 }); //expires in ten days }); Then do something like this to get the values on load: if ($.

Cookie("mycookie") { //check if the cookie exists myrows = $. Cookie("mycookie"); //then get the values } else { //do something else if the cookie does not exist } If attr() is'nt working for you, try prop().

A vote for some very useful suggestions.. did not know about .prop().. interesting method – stebbin45 Oct 7 at 17:22.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions