Results 1 to 3 of 3
- 04-29-2008, 09:28 PM #1
Member
- Join Date
- Apr 2008
- Posts
- 1
- Rep Power
- 0
nebie popup script, need to add code.
Hello all, simple question for you. This is my code:
I need to add on it a function that put the popup in the middle of the screen.Java Code:<SCRIPT TYPE="text/javascript"> <!-- function popup(mylink, windowname) { if (! window.focus)return true; var href; if (typeof(mylink) == 'string') href=mylink; else href=mylink.href; window.open(href, windowname, 'width=400,height=323,scrollbars=no'); return false; } //--> </SCRIPT>
Also if I can change the backgrond color to black how can I do it?
Thank you for you help.
- 04-30-2008, 10:44 AM #2
Hello Lilith2014.
These forums are for Java questions. JavaScript is actually a completely different language.
I suggest you search google for a dedicated JavaScript forum. You will find a lot more help there than here!
Another google search revealed this:
To call this function in HTML use this:Java Code:<SCRIPT LANGUAGE="JavaScript"> function MyPopUpWin() { var iMyWidth; var iMyHeight; //half the screen width minus half the new window width (plus 5 pixel borders). iMyWidth = (window.screen.width/2) - (75 + 10); //half the screen height minus half the new window height (plus title and status bars). iMyHeight = (window.screen.height/2) - (100 + 50); //Open the window. var win2 = window.open("filename.htm","Window2","status=no,height=200,width=150,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no"); win2.focus(); } </SCRIPT>
Java Code:<A HREF="javascript:MyPopUpWin()">This is the link</a>
Last edited by DonCash; 04-30-2008 at 10:48 AM.
Did this post help you? Please
me! :cool:
- 12-30-2010, 11:09 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
Java Popup Window & Url Query String Value
By Rivelyn in forum New To JavaReplies: 4Last Post: 01-20-2011, 05:03 AM -
how we get popup window in java
By baserohit in forum Advanced JavaReplies: 1Last Post: 03-22-2008, 04:39 AM -
Communicating with JSP and popup
By nilz in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 11-20-2007, 04:29 PM -
Popup in Java
By fernando in forum New To JavaReplies: 1Last Post: 08-07-2007, 06:55 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks