最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to dynamically change the size of popup.html for Google Chrome extensions - Stack Overflow

programmeradmin3浏览0评论

The goal is to change the size of my chrome extension popup (different from a normal popup window) dynamically when the user clicks on a button.

I tried to hide the elements I have on the page by setting the hidden attribute to true. I also tried to change the window size with window.resizeTo, but nothing works.

Note: I can enlarge the window, but I can't shrink it back

The goal is to change the size of my chrome extension popup (different from a normal popup window) dynamically when the user clicks on a button.

I tried to hide the elements I have on the page by setting the hidden attribute to true. I also tried to change the window size with window.resizeTo, but nothing works.

Note: I can enlarge the window, but I can't shrink it back

Share Improve this question asked May 18, 2011 at 22:41 Tony StarkTony Stark 3,4637 gold badges28 silver badges30 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Just adjust the css width property of <body> element. Can also do the same with <html> for good measure.

document.body.style.width="100px";
document.getElementsByTagName("html")[0].style.width="100px";
发布评论

评论列表(0)

  1. 暂无评论