[Tutorial] Make a pop-up

This is guide mostly for website tools and code, for example CMS or registration scripts.
There can also be tools.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[Tutorial] Make a pop-up

Postby blacksnow on Tue Sep 11, 2007 9:40 am

Im from Vietnam and my E is bad, sry if my grammar is false

Simple, just 2 steps to make a pop-up window

Step 1:
U have a index file, copy this scrip into <head>...</head> section of yours
<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=200,scrollbars=yes');
return false;
}
//-->
</SCRIPT>

width=400 : Width of pop-up page
height=200 : Height of pop-up page
scrollbars=yes/no : enable/disable scrollbars
Change them to what ever u want

Step 2:
The script above opens the pop-up, but something needs to run the script, so make a link for user click on it:
Example, u have votelink.html
<A HREF="votelink.html" onClick="return popup(this, 'pop-up')">Vote for us</A>

votelink.html : link to your correct file
pop-up : name of pop-up page

NOW WE DONE !
blacksnow
Pomic
Pomic
 
Posts: 81
Joined: Sat Aug 25, 2007 6:35 am

Re: [Tutorial] Make a pop-up

Postby Rifke on Tue Sep 11, 2007 4:03 pm

There are more parameters to play with than just width,height & scrollbars.

http://msdn2.microsoft.com/en-us/library/ms536651.aspx
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium


Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 4 guests