NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [resolved] Question need help fast plz!

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 01-09-2003, 01:09 PM THREAD STARTER               #1 (permalink)
New Member
Join Date: Jan 2003
Posts: 16
GamerX is an unknown quantity at this point
 



Question need help fast plz!


I am running into serious problems w/ something i want to do w/ links. What i want to do and have seen in some websites is when a link is clicked a new window pops up resized and located somewhere other than in the center. how is this done. I have an example page but at the moment its under construction so i cant post it at the moment. does anyone know what i mean and can anyone help. if so email me or IM me. faster than readin a post
GamerX is offline  
Old 01-09-2003, 01:39 PM   #2 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



This may work for you:
????: NamePros.com http://www.namepros.com/programming/14412-resolved-question-need-help-fast-plz.html

First create a litlle function:

<script language="JavaScript">
function popUP() {
myWin = window.open("/page.html", "","toolbar=no,location=no,directories=no,menubar= no,scrollbars=no,resizable=no,left=60,top=60,width =600,height=400")
}
</script>

Then call it by the name of the function like this:

<a href="javascript:popUP();">Click Here To Open A New Window</a>

This part should all go on one line:
myWin = window.open("/page.html", "","toolbar=no,location=no,directories=no,menubar= no,scrollbars=no,resizable=no,left=60,top=60,width =600,height=400")

You can change the left and top numbers to adjust the window to pop up in different locations.
deadserious is offline  
Old 01-09-2003, 01:56 PM THREAD STARTER               #3 (permalink)
New Member
Join Date: Jan 2003
Posts: 16
GamerX is an unknown quantity at this point
 



Thnx but...


I still dont understand. Is there any way you can clarify this example a bit more for someone who really does not fully understand javascript. And i use dreamweaver if that helps any...
GamerX is offline  
Old 01-09-2003, 02:12 PM   #4 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



In your html page where you're calling the pop up from add this code anywhere in the body section:


<script language="JavaScript">
function popUP() {
myWin = window.open("/page.html", ""," toolbar=no,location=no,directories=no,menubar=no,s
crollbars=no,resizable=no,left=60,top=60,width=600
,height=400")
}
</script>


You would need to change this part:
(/"page.html"

to the actual url of the page you want in the pop up window.

Then where ever you want the link to appear that is clicked to open the popup window add this:

<a href="javascript:popUP();">Click Here To Open A New Window</a>
deadserious is offline  
Old 01-09-2003, 02:18 PM   #5 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Here I uploaded a text file that you can look at to get a better example. You can save it as a .html file to your computer to see it in action.
Attached Files
File Type: txt popup.txt (344 Bytes, 1 views)
deadserious is offline  
Old 01-09-2003, 02:27 PM THREAD STARTER               #6 (permalink)
New Member
Join Date: Jan 2003
Posts: 16
GamerX is an unknown quantity at this point
 



Thnx again im startin to...


Understand but how can i add more links on the page that do the same thing?
GamerX is offline  
Old 01-09-2003, 02:37 PM   #7 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



You can add another function with another name. Then call the new popup with the new name.

For example you could name it popUP2

function popUP2() {

Then call it with popUP2 in your link.

<a href="javascript:popUP2();">Click Here To Open A New Window</a>

There's other ways to do it also without creating a new function for each different pop up. I'll see if I can find something and post it.
deadserious is offline  
Old 01-09-2003, 03:01 PM THREAD STARTER               #8 (permalink)
New Member
Join Date: Jan 2003
Posts: 16
GamerX is an unknown quantity at this point
 



thanx a bunch...


ill keep checking in for any new info for now this should be enpugh thanx alot for the help tho
GamerX is offline  
Old 01-09-2003, 04:31 PM   #9 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Well you can try something like this for each link:

<a href="#" onclick="window.open('page2popup.htm','WindowName' ,'toolbar=no,location=no,directories=no,menubar=no ,scrollbars=no,resizable=no,left=60,top=60,width=6 00,height=400');return false">link</a>

Then you wouldn't have to create all them functions for each link.
There's alot of different ways of doing it, but maybe that will work for you.
deadserious is offline  
Old 01-09-2003, 07:31 PM THREAD STARTER               #10 (permalink)
New Member
Join Date: Jan 2003
Posts: 16
GamerX is an unknown quantity at this point
 



ugh!


for some reason when i input the code and preview it it doesnt work. What could i be doing wrong?

-And on your previous post the "#" icon, do i replace it w/ something other than that or leave it be? Sorry to be bugging so much but im no good w/ java script nor HTML all too well.
GamerX is offline  
Old 01-09-2003, 09:04 PM   #11 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



I Uploaded another file you can take a look at and try it out.

You would leave the # just like it is.

:beer:
Attached Files
File Type: txt popup.txt (231 Bytes, 2 views)
deadserious is offline  
Old 01-10-2003, 08:11 PM   #12 (permalink)
NamePros Regular
Join Date: Sep 2002
Location: Canada
Posts: 481
DarkDevil is an unknown quantity at this point
 



I would normally just use target="_blank" but i think that would center it.
__________________
Sometimes I lay awake at night and I ask "Where have I gone wrong?" Then a little voice says "This is going to take more than one night"
DarkDevil is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:57 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger