Jump to content
Twango

Jquery Frameset Slide

Recommended Posts

I have a page with a frameset, let's say its frameholder.php, It has a frameset with Row1 at %100 and Row2 at %0.I want the frame at Row1 to have a button on it, that when you click it, in the parent, it slides frame 2 up to %50.I can't get this to work for the life of me. Please help!

Share this post


Link to post
Share on other sites

I thought frames, as dead and buried nm, to access the frameset parent page you would use

parent.document.body.rows = '100,*';

to

parent.document.body.rows = '50,50';

but how you are going to get this to slide/animate ???? setTimeout() maybe, good luck!

Edited by dsonesuk

Share this post


Link to post
Share on other sites

So far I have the following, as well as a button.<script type="text/javascript" src="jquery.js"></script><script type="text/javascript">$(document).ready(function(){$(".flip").click(function(){ $("parent.document.body.rows").slideToggle("slow"); });});</script>Still not working...

Share this post


Link to post
Share on other sites

And the parent thing didn't work, when I'm using it asdocument.getElementById('parent.document.bindex').rows="*,%20";I tried changing it to CSS3... with 2 second transition on rows, still not working.It says that document.getElementById('parent.document.bindex') is null.

Share this post


Link to post
Share on other sites

document.getElementById('parent.document.bindex') is null because there is no element with that ID. You use document.getElementById to access an element by its ID attribute. You have the same problem with the jQuery code, you're passing that as an element selector, which should be a CSS selector. Even so, there's nothing in the jQuery code to support what you're trying to do, you're not telling it to change the height by any amount. The slideToggle method probably uses CSS height. If you can specify the frame height with CSS then you may be able to use that method to change it.

Share this post


Link to post
Share on other sites

Its very difficult to use slide or animate to adjust the rows, as you will be targeting two values, that why i suggested setTimeout. this example works in firefox, chrome, safari but fails in opera, and IE.

 col1=100;$(document).ready(function()    {$("#change_height").click(function(){if(col1>50 && col1<=100){adjustthis()}else{parent.document.body.rows = '50%, 50%';}});});function adjustthis(){col1--;col2=100-col1;if(col1<=50){parent.document.body.rows = '50%, 50%';clearTimeout(p);}else{parent.document.body.rows = "'"+col1+"%, "+col2+"%'";p = setTimeout("adjustthis()",(5));}}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...