Load a modal window from a bookmarklet (like the Amazon wishlist bookmarklet)

后端 未结 4 1103
后悔当初
后悔当初 2021-02-02 02:59

I am using a bookmarklet to load an html page which all works great, but, doesn\'t look so hot due to browsers generally being ugly around the outside!

Is there a way t

4条回答
  •  心在旅途
    2021-02-02 03:15

    Simplest, most light-weight solution would be to use window.open.

    Something like the following will display a 600x250 window in the middle of the screen. Only the titlebar will show, which can show the title of the window.

    Paste this in your browser's URL field to try it out:

    javascript:(function()%7Bvar%20d=document;window.open('http://stackoverflow.com','_blank','width=600,height=250,left='+(screen.width/2-300)+',top='+(screen.height/2-125))%7D)();
    

提交回复
热议问题