How does the DiggBar dynamically resize its iframe's height based on content not on their domain?

前端 未结 5 2147
南方客
南方客 2020-12-13 01:08

Someone has already asked, How does the DiggBar work? in a previous question.

While someone provided a decent answer it didn\'t address one thing:

5条回答
  •  清歌不尽
    2020-12-13 01:58

    Part of the problem with HTML you can't just set an element of any thing to 100% height and have it take up the whole window space. One way to do this is by making the body have a pixel height of the window and any thing inside the body set to 100% will be the size of the window.

    Basically just make a JavaScript that ties onto the windows onresize event and have it resize the body to to the size of the window.

    here is an example I made using jQuery

    
    

    With this you will be able to set a div or another elements and have it work at the full height of the window.

提交回复
热议问题