Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-29-2008, 10:28 PM
Member
 
Join Date: Apr 2008
Posts: 1
lilith2014 is on a distinguished road
nebie popup script, need to add code.
Hello all, simple question for you. This is my code:

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>
I need to add on it a function that put the popup in the middle of the screen.
Also if I can change the backgrond color to black how can I do it?

Thank you for you help.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-30-2008, 11:44 AM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
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:

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>
To call this function in HTML use this:

Code:
<A HREF="javascript:MyPopUpWin()">This is the link</a>
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by DonCash : 04-30-2008 at 11:48 AM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how we get popup window in java baserohit Advanced Java 1 03-22-2008 05:39 AM
Simple Ant script JavaForums Java Blogs 0 02-16-2008 11:53 PM
Communicating with JSP and popup nilz JavaServer Pages (JSP) and JSTL 0 11-20-2007 05:29 PM
Popup in Java fernando New To Java 1 08-07-2007 07:55 AM
Java Popup Window & Url Query String Value Rivelyn New To Java 1 06-28-2007 11:48 PM


All times are GMT +3. The time now is 10:54 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org