Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-20-2002, 08:31 AM   PM User | #1
bibi
New to the CF scene

 
Join Date: Jun 2002
Location: holland
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
bibi is an unknown quantity at this point
Unhappy ScriptConfusion

HI
I´m new with JavaScript and I have a question. I surfed dozins of forums 2 find the answer but I got all confused with so many (mostly just slightely different) codes & scripts.
Here is what I want 2 know:
I made a flash intro, and then a button appears, and when u click it, I want a popup window 2 open (not fullscreen, not centered).
Now I collected many codes but I really can´t seem 2 find out WHICH part I should paste WHERE...
Could u please make an example (as for a child) 2 help me out?!
I´d appriciate it a lot!Thanxx!!
bibi is offline   Reply With Quote
Old 06-20-2002, 08:35 AM   PM User | #2
Zvona
Regular Coder

 
Join Date: May 2002
Location: Helsinki, Finland
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Zvona is an unknown quantity at this point
Lightbulb

It'll always help us, if you post an URL or your source code here. That helps us to offer you a firm and proper answer faster, when we know the "environment".

So, post an URL or a part of your code.
__________________
Zvona
First Aid for
Web Design
Zvona is offline   Reply With Quote
Old 06-20-2002, 06:39 PM   PM User | #3
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
look at this

Pop Up Window Generator
A1ien51 is offline   Reply With Quote
Old 06-21-2002, 08:54 AM   PM User | #4
newmate
New Coder

 
Join Date: Jun 2002
Location: Colorado, USA
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
newmate is an unknown quantity at this point
Ok, let's see if I can break it down for you.
First, the script you create with the two parts 1="head" in red and 2="body"in green you will cut and paste ---->

<html>
<head>
<title>PopUpScript</title>
<script>
function PopUp(PopUpUrl){
var ScreenWidth=window.screen.width;
var ScreenHeight=window.screen.height;
var movefromedge=0;
placementx=500;
placementy=300;
WinPop=window.open(PopUpUrl,"","width=400,height=300,toolbar=0,location=0,directories=0,status=0,scr ollbars=1,menubar=0,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screen Y="+placementy+",");
}
</script>

</head>
<body onload="PopUp('http://www.A1ien51.8k.com')">
</body>
</html>


Here it is used in a small page --->

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>This is it</title>
<script>
function PopUp(PopUpUrl){
var ScreenWidth=window.screen.width;
var ScreenHeight=window.screen.height;
var movefromedge=0;
placementx=500;
placementy=300;
WinPop=window.open(PopUpUrl,"","width=400,height=300,toolbar=0,location=0,directories=0,status=0,scr ollbars=1,menubar=0,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screen Y="+placementy+",");
}
</script>



</head>

<body>

<table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="200" id="AutoNumber1" height="1000">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp;<img border="0" src="pic5.jpg" width="207" height="342">&nbsp;&nbsp; </p>
<p><font size="7">This is it</font></p>
<body onload="PopUp('http://codingforums.com/showthread.php?s=&threadid=392')">
</body>

</html>

Note: 1, This <head> starts the head section and this </head> ends it. This <body> or <body background=somediscriptionofacolororgraphicfilesourcehere> starts the body section and this </body> ends it.
Note: 2, I replaced the url in the green onload body tag with the url for this page so in this example you will see a moveable, scrollable popup of this post. This is where you put the url to the page you want in the popup. Be sure to put your url inside the (' and the ')"> parts
Note: 3, You may need to make a blank type page to host your flash intro because this popup script is coded for url's and not a direct path to a folder or file.
__________________
Editor; FrontPage 2002 (included in Office XP). Personal Operating System; Windows XP and ME. Browsers; Latest versions, NN, IE and Opera. Server running; RedHat Linux 7.2

Last edited by newmate; 06-21-2002 at 10:05 AM..
newmate is offline   Reply With Quote
Old 06-21-2002, 10:23 AM   PM User | #5
bibi
New to the CF scene

 
Join Date: Jun 2002
Location: holland
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
bibi is an unknown quantity at this point
THANXXX

I wanna thank yall for your time & effort. I´ll try all the tips and codes and then get bakc to U !!!!!!!!!!!
bibi is offline   Reply With Quote
Old 06-21-2002, 12:32 PM   PM User | #6
bibi
New to the CF scene

 
Join Date: Jun 2002
Location: holland
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
bibi is an unknown quantity at this point
here the codes

Okay, I did some homework--I´ve visited popup generator, very handy!
But I still can´t make the button work in my flash intro...
I´ve also tried to work with your codes, Newmate, but unfortunately it did´nt get me what I needed...thanx anyway!
So here´s the codes that I try 2 work with.
First I give u the code of the button and what it does, so u get an impression of what I want 2 happen:

<HTML>
<HEAD>
<TITLE>trial</TITLE>
<script language=javascript>
function openwindow()
{
window.open("http://www.mediaperspectief.nl", "openwindow", "width=300,height=300,left=50,top=50")
}
</script>
</HEAD>

<BODY bgcolor="#FFFFFF">
<form> <center><p>&nbsp;<input type=button value="consultancy" onclick="openwindow()" NAME="consultancybutton"></p></center></form><!-- URL's used in the movie-->
<!-- text used in the movie-->
</BODY>
</HTML>

And here´s the code for the flashmovie in which the button has to trigger the popup window, which is definitly not happening...

<HTML>
<HEAD>
<script language=JavaScript>
function openNewWindow(URLtoOPen, windowName, windowFeatures)
{
newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}
</script>
<TITLE>trialmovie</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<A HREF=javascriptpenNewWindow ('www.mediaperspectief.nl','thewin','height=300,width=400,top=50,left=50')"); }></A> <!-- text used in the movie-->
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=550 HEIGHT=400> swLiveConnect=true NAME=button.swf
<PARAM NAME=movie VALUE="trialmovie.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="trialmovie.swf" quality=high bgcolor=#FFFFFF WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</BODY>
</HTML>


Okay, beatiful if anyone could unsolve this mistery 4 me!!


Petr@
bibi is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:56 AM.


Advertisement
Log in to turn off these ads.