jquery - Javascript: How to resize frame? - Stack Overflow

How to, using JavaScript, resize frame inside frameset?I've found jQuery slideUp () function very

How to, using JavaScript, resize frame inside frameset?

I've found jQuery slideUp (/) function very useful, however it's not possible to implement it to work with the frame.

How to, using JavaScript, resize frame inside frameset?

I've found jQuery slideUp (http://api.jquery./slideUp/) function very useful, however it's not possible to implement it to work with the frame.

Share Improve this question edited Dec 16, 2010 at 0:49 user142162 asked Dec 16, 2010 at 0:46 PaulPaul 1,9668 gold badges25 silver badges32 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

To resize a frame, you'll have to change the rows/cols -attribute of the parent frameset-element.

Short example:

<html>
<head>
<script>
window.onload=function()
{
  var frame=window.frames[0];
      frame.document.open();
      frame.document.write('<input  type="button" \
                                    onclick="parent.fx()" \
                                    value="resize this frame to 150px height">');
      frame.document.close();
}
var i=50;
function fx()
{

  timer=setInterval(
                    function()
                    {
                      if(i>150)
                            {
                              clearTimeout(timer);
                            }
                      else  {
                              document.getElementsByTagName('frameset')[0]
                              .setAttribute('rows',(i++)+',*');
                            }
                    }
                    ,20)
}
</script>
</head>
<frameset rows="50,*">
  <frame src="about:blank"/>
  <frame src="about:blank"/>
</frameset>
</html>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743700699a4492519.html

相关推荐

  • jquery - Javascript: How to resize frame? - Stack Overflow

    How to, using JavaScript, resize frame inside frameset?I've found jQuery slideUp () function very

    17小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信