|
|
Use this script to open browser pop-up windows when you click a link or an image
The script can position the new window at a given x and y position on the screen, you can specify window width, height and you can specify what other items to apear or to hide on the window (buttons, status bar, etc)
Copy and paste this code in the <head>...</head> area of your code:- <script language="JavaScript" type="text/javascript">var popUpWin=0;function popUpWindow(URLStr, left, top, width, height){ if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); } popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no, status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+ ',height='+height+',left='+left+', top='+top+',screenX='+left+', screenY='+top+'');}</script>
复制代码 Then add this code to a normal href link (inside the <a> tag):
onclick="javascript:popUpWindow('http://www.thewebhelp.com','200','200','320','240')"
So that your link looks like this:- <a href="#" onclick="javascript:popUpWindow('http://www.thewebhelp.com','200','200','320','240')">Open a pop-up</a>
复制代码 |
|