Jump to content

Jquery Frameset Slide


Twango

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!

Link to comment
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...

Link to comment
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.

Link to comment
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.

Link to comment
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));}}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...