0

Essentially - I want the button onClick to open a new window without a fixed size; however, I have no idea how to accomplish this. I've done much research with no success.

This is what I have so far:

<button class="tealbutton tooltip"
    onClick="window.open('http://google.com','1','width =700,height=500')">         
</button>

If I remove the width and height and click on the button - a new tab will open. I want a new window to open instead.

Your help is appreciated!

Thanks

user1652920
  • 149
  • 2
  • 5
  • 17

2 Answers2

0

You can't override whether it opens a new tab or window, it is down to the user's browser preferences. See here.

Community
  • 1
  • 1
toomanyredirects
  • 1,972
  • 15
  • 23
0

The 3rd paramter to window.open also controls the new window's "features". See https://developer.mozilla.org/de/docs/DOM/window.open

Available features:

menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes

Use resizable=yes.

marekful
  • 14,986
  • 6
  • 37
  • 59