lilbiscuit
lilbiscuit

Reputation: 2249

How to change frame height from another frame in frameset with javascript

I have a frameset:

<frameset rows="30px,*">
    <frame id="frame1" src="frame1source.html">
    <frame id="frame2" src="frame2source.html">
</frameset>

I need to be able to change the height of #frame2 from within #frame1 using jquery.

I tried many solutions to no avail, including:

$(window.parent.frames[0].document).css("height",300);

Upvotes: 2

Views: 7581

Answers (3)

Ajeet Malviya
Ajeet Malviya

Reputation: 804

You can use below tag :

$("#fromdate, #todate").click(function () {
        $('frameset', top.document).eq(2).attr('rows', '300,*');
    });

Upvotes: 0

lilbiscuit
lilbiscuit

Reputation: 2249

Ok I solved this using pure JS by resizing the frameset, not just one frame.

parent.document.getElementsByTagName( 'frameset' )[ 0 ].rows="300,*";

Upvotes: 3

Russo
Russo

Reputation: 341

$("#frame2").css("height",300); This works for you ?

Upvotes: 0

Related Questions