| View previous topic :: View next topic |
| Author |
Message |
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8749 Location: Castle Pines North, CO USA
|
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Tue Jun 22, 2004 2:46 am |
|
|
|
| Are you saying that you doubled up the script in the head portion of the HTML? That shouldn't be required. |
|
ambreeze
Joined: 19 Jun 2004 Posts: 19
|
Posted: Tue Jun 22, 2004 12:00 pm pop up windows for a FrontPage website |
|
|
|
Well, I DID try that, but it didn't work out too well. Then I tried just adding the second html address after where the first one was with a ";" between the addresses, but it didn't work either, so either you can't do that like that, or my syntax was wrong...
T. |
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Tue Jun 22, 2004 12:30 pm |
|
|
|
| Are you using the version you posted the code for or the one Cory posted? |
|
ambreeze
Joined: 19 Jun 2004 Posts: 19
|
Posted: Tue Jun 22, 2004 1:14 pm pop up windows for a FrontPage website |
|
|
|
I'm using the one I posted before - it was generated by the software on this site. But I removed the absolute addresses as suggested by you guys and it worked great. But both sections of code have the .html address in them. I know the second part of code (that refers to the onClick function) will ONLY have the address I want to have come up in it, but the first section will have the additional address - right?
I'll post the part that I think should have both addresses in it:
<script language='javascript'>
<!--
/********************************************
AUTHOR:WWW.CGISCRIPT.NET.LLC
URL:http://www.cgiscript.net
Use the code for FREE but leave this message intact
Download your FREE CGI/Perl Scripts today!
( http://www.cgiscript.net/scripts.htm )
****************************************************/
var acePopupWindow=null;
function acePopup(mypage,myname,w,h,pos,infocus){
if(pos=='random'){
LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=='center'){
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!='random') || pos==null){LeftPosition=100;TopPosition=100;}settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,dependent=no';
acePopupWindow=window.open('',myname,settings);
if(infocus=='front'){acePopupWindow.focus();acePopupWindow.location='popup_shorts.htm';}
}
//-->
</script>
I made bold the part where I think I should add the second .htm address, but I'm unsure of the syntax
OOOORRRRR, can't I do it like this?
T. |
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Tue Jun 22, 2004 1:30 pm |
|
|
|
I played around with the one Corey posted because there is no reference to any HTMl files for the popups in his javascript. I pasted it into a running test page I have for answering questions on this forum and uploaded it to my server. Its just a table with a mapped gif in the center. The links on the map don't go anywhere.
On the top there is a link for popup 1 and popup 2. These two popups use the same window.
On the bottom you will see links for popup 3 and popup4. These open in their own windows.
Look at the source code that Corey posted where the javascript function is created -
| Code: |
| function NewWindow(mypage,myname,w,h,pos,infocus) |
It creates the function called NewWindow that requires the variables mypage,myname,w,h,pos,infocus.
When you call the function in the link (look at my source code) -
| Code: |
| <a href="javascript:NewWindow('popup1.html','test1popup','300','400','random','front');">POPUP 1</a> |
the link calls for the function created in the javascript and feeds it the values of the variables. As long as I keep using the the same value for myname the popup will keep using the same window. As soon as I use a different string for myname (look at my source code for the bottom two links) it create a new popup window. You can play around with the infocus to alter the way the windows appear (foreground/background) |
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Tue Jun 22, 2004 1:32 pm |
|
|
|
By the way, I sent you down the garden path when I gave you the Apache link, its not compiled to run javascript. Sorry about that.
But you should be able to add the module. |
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Tue Jun 22, 2004 1:53 pm |
|
|
|
This is for Corey -
What are the possible values for the infocus variable and what do they do?? |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8749 Location: Castle Pines North, CO USA
|
Posted: Wed Jun 23, 2004 5:18 am |
|
|
|
front or back I think are the only two. Front puts the pop-up in front.
I think that it is a lot more. If we could see the entire code on a website, it will be a lot easier. I think there might be some FP generated code somewhere that is corrupting it. |
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Wed Jun 23, 2004 5:32 am |
|
|
|
| Corey, I think ambreeze was still trying to make the "canned" script work which referenced the popup HTML in the HEAD section of the script. Thats why ambreeze is having trouble with multiple popups. If the snipet of code you posted is used it works just fine as long as you use a unique value for myname for each popup window required. If the value for myname is the same in every link tag then the popup will use the same window over and over. The function NewWindow can be used in as many links as required. |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8749 Location: Castle Pines North, CO USA
|
Posted: Wed Jun 23, 2004 5:35 am |
|
|
|
As I recommended, use the wizard that was on the site & not the software. I had a lot of problems with it a few years ago & never looked at it again. The wizard works great for me & I have one site that uses numerous pop-ups.
With the wizard - there is no need to use multiple scripts in the head since the size of each pop-up is located in the body. |
|
ambreeze
Joined: 19 Jun 2004 Posts: 19
|
Posted: Thu Jun 24, 2004 5:38 am |
|
|
|
I will try Corey's code with the other advise too, I'm sure it'll work just fine, and once again... THANKS!
Terri |
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Thu Jun 24, 2004 9:10 am |
|
|
|
| Quote: |
| I played around with the one Corey posted because there is no reference to any HTMl files for the popups in his javascript. I pasted it into a running test page I have for answering questions on this forum and uploaded it to my server. Its just a table with a mapped gif in the center. The links on the map don't go anywhere. |
I just realized I didn't post a link to the test site -
http://www.buildersmatrix.com/info/map.html |
|
ambreeze
Joined: 19 Jun 2004 Posts: 19
|
Posted: Thu Jun 24, 2004 4:36 pm |
|
|
|
very nice!
Hey, I just realized that YOU probably have colder weather than even I do... maybe Corey would be kind enough to write some kind of script that would send us some of his warm and sunny weather!
Terri |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8749 Location: Castle Pines North, CO USA
|
Posted: Thu Jun 24, 2004 5:37 pm |
|
|
|
| You're kidding? I'm keeping that ALL to myself! LOL |
|
|