4

I am working with chrome extension.

Here in button click i required to open a menu. When toolbar loaded in memory it make a space for menu item I want to remove it in page load.

Before Button click After Click button

Yashwant Kumar Sahu
  • 3,356
  • 7
  • 27
  • 42

1 Answers1

1

Assuming there is no visible elements taller than 100px on the popup page:

document.body.style.height="100px";
document.getElementsByTagName("html")[0].style.height="100px";

If this doesn't work then some element is still considered visible (Chrome is picky about this).

The best way to figure it out would be to use the popup inspector.

  • Right click on the popup icon, select "inspect pop-up".
  • Set height for <html> and <body> elements
  • Set height for your container div
  • Play with height, overflow:hidden, float:left, display:none on a container div and its children until popup shrinks to the required height
serg
  • 109,619
  • 77
  • 317
  • 330