PDA

Arată versiune întreagă : [ofer] Pop-up script



ev0l
04.01.2010, 10:46
Revin cu mai multe !
Sa dea dracii sa nu apasati butonul "multumesc"
Alte tutoriale pop-up , cum sa il faceti , mai dezvoltat : Url = javascripttoolbox.com/lib/popup/example.php

<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 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Smile Popup</title>

<meta name="Microsoft Theme" content="none">
<meta name="Microsoft Border" content="none">
</head>

<body topmargin="2" leftmargin="2" bgcolor="#FFFFFF" link="#DC143C" vlink="#DC143C" alink="#000080" background="../images/puzzleBG.gif" bgproperties="fixed"><CENTER><b><font size="7" face="Comic Sans MS">Ü </font></b>

<table border="1" cellpadding="0">
<tr>
<td width="100%" bgcolor="#C0C0C0" bordercolorlight="#000000" bordercolordark="#FFFFFF"><font size="1" face="Verdana"><a href="javascript:window.close()" style="COLOR: #000000; TEXT-DECORATION: none"><font size="1">close
this window</font></a></font></td>
</tr>
</table>
<p><font size="2" face="Verdana"><b><a href="http://threeclicks.com" target="_blank">ThreeClicks.com</a></b></font></center></body>

</html>


Pop-up inchidere dupa 10 secunde


================================================== ==========
Script: Automatic Timed Self-Closing Popup Window

Function: Opens a window that will close itself after a
pre-set time. The popup can be launched from
a link in your page, or automatically when the
launching page loads. Very well behaved, and
does not launch multiple windows on re-clicks.

Browsers: All browsers

Author: etLux
================================================== ==========

General Notes:

There are two short scripts. One launches the popup window
and goes in the page that will launch it. The other goes
in the window that is opened.

================================================== ==========

Step 1. The Launching Page Code

Put the following script in the <head> ... </head> part of
the launching page. Set theURL to that of the page to be
launched. The width and height variables set the size of
the launched window.

Be careful to get the entire long line...

newWindow = window.open(...);

on a single line in your page, since spaces or linebreaks
will cause this to fail, otherwise.

You can set which features are active in the popup window
(toolbar, menubar, resizable, scrollbars, status, location)
by changing the word no to yes for each of the associated
variables in the window.open() call.

Here is the script...

<script>
// (C) 2001 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header

var theURL = 'thePopupPage.html';
var width = 300;
var height = 400;

function popWindow() {
newWindow = window.open(theURL,'newWindow','toolbar=no,menubar =no,resizable=no,scrollbars=no,status=no,location= no,width='+width+',height='+height);
}
</script>

Launching the Popup Window...

To launch the popup from a link put this in your page where
you want the launching link to appear:

<a href="javascript:popWindow()">Click here</a>

Another popular usage is to launch the popup window when
the launching page is entered. You can do this by calling
the function in the <body> tag, like this:

<body onload="popWindow()">

================================================== ==========

Step 2. The Popup Window Code

This code must go in the <head> ... </head> part of the
window that is launched (in theURL variable, above). The
time for the window to remain open is set with the variable
howlong, in milliseconds (that is, var howlong = 10000 would
keep the window open ten seconds after it loads.

<script>
// (C) 2001 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header

var howLong = 10000;

t = null;
function closeMe(){
t = setTimeout("self.close()",howLong);
}

</script>

IMPORTANT

You must *also* call the function in the <body> tag of the
popup window, like this:

<body onload="closeMe();self.focus()">

Note the use of self.focus(), which brings the popup to
the front when it loads.

================================================== ==========

Additional Notes:

If you want to put a self-close link in the popup window,
it is done like this:

<a href="javascript:self.close()">click here</a>

================================================== ==========




<!-- BEGIN FLOATING LAYER CODE //-->
<div id="theLayer" style="position:absolute;width:450px;left:100;top:100;vis ibility:visible">
<table border="0" width="450" bgcolor="#FF6633" cellspacing="0" cellpadding="5">
<tr>
<td width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">
<tr>
<td id="titleBar" style="cursor:move" width="100%">
<ilayer width="100%" onSelectStart="return false">
<layer width="100%" onMouseover="isHot=true;if (isN4) ddN4(theLayer)" onMouseout="isHot=false">
<font face="Arial" color="#FFFFFF">Amazing Popup Window - Drag me!</font>
</layer>
</ilayer>
</td>
<td style="cursor:hand" valign="top">
<a href="#" onClick="hideMe();return false"><font color=#ffffff size=2 face=arial
style="text-decoration:none">X</font></a>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF" style="padding:4px" colspan="2">
<!-- PLACE YOUR CONTENT HERE //-->
<p>This is where your content goes.<br>
You can change the width and color.
<br>
It expands downward to accomodate its content
<br>
It can contain any html code or text
.<br>
Here are some examples:<br><img src="images/catsmeow.jpg">
<br>
Click <a href="javascript:hideMe();">HERE</a> to HIDE the Popup Window. <br>
Another example of hidden content that can be made visible instantly with a mouse
click - and the user can place it anywhere on screen:

<form name="form1" method="post" action="mailto:jbsurv@theopensourcery.com?subject=Yeah, its great!">
Do you like it ? <input name="namer" type="text" value="Yeah, its great!" size="32" maxlength="128">
<br>
<input type="submit" name="Submit" value="Spam theSourcery" >
</form></p>
<!-- END OF CONTENT AREA //-->
</p></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!-- END FLOATING LAYER CODE //-->

Halincea
04.01.2010, 11:31
Acesta este scriptul
<script type="text/javascript" language="javascript">
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(6*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}




function popMarket(url){



var x = readCookie('popup-crk');

if (!x) {
createCookie('popup-crk','1',1);
window.open(url);
}


}
</script>


<body onClick="popMarket('http://site.ro/');
----------------------------------------------

ev0l
04.01.2010, 11:37
<html>

<head>
<title>URL Redirect</title>
<meta http-equiv=refresh content=0;URL="javascript:history.back(-1);">
</head>

<script language="javascript">
function bustOut(){
var newWin = window.open("http://LocationOfPopupPage", "subWindow","height=500,width=700,resizable=yes,scrollbars=yes");
}
window.onLoad = bustOut;
</script>

<body onLoad="bustOut()">
<p align="center"><br>
<font face="verdana, arial, helvetica"><span style="font-size:8.5pt;font-family:verdana, arial, helvetica">
<strong><br>
This The document is located on an internal site. The document will now be opened for you from the internal site</strong></span></font><p align="center"><font face="verdana, arial, helvetica"><p align="center"><font face="verdana, arial, helvetica"><span style="font-size:8.5pt;font-family:verdana, arial, helvetica"><strong>You will now be redirected back to the previous page</strong></span>
</body>
</html>

Fara fereastra , modifici cu asa ceva :


function bustOut(){
var newWin = window.open("http://cwr.ro", "_blank");
}
window.onLoad = bustOut;

Pentru click - redirect automat :


<html>

<head>
<title>URL Redirect</title>
<meta http-equiv=refresh content=0;URL="javascript:history.back(-1);">
</head>

<script language="javascript">
function bustOut(){
var newWin = window.open("http://cwr.ro", "_blank");
}
window.onLoad = bustOut;
</script>

<body onClick="bustOut()">
<p align="center"><br>
<font face="verdana, arial, helvetica"><span style="font-size:8.5pt;font-family:verdana, arial, helvetica">
<strong><br>
This The document is located on an internal site. The document will now be opened for you from the internal site</strong></span></font><p align="center"><font face="verdana, arial, helvetica"><p align="center"><font face="verdana, arial, helvetica"><span style="font-size:8.5pt;font-family:verdana, arial, helvetica"><strong>You will now be redirected back to the previous page</strong></span>
</body>
</html>

Dupa " <body onClick="bustOut()"> " sa fie site-ul vostru , la click - redirect url cwr.ro


Pentru 2 site-uri
Modificati cu

<script language="javascript">
function bustOut(){
var newWin = window.open("http://cwr.ro","_blank");
var newWin = window.open("http://www.cwr.ro/forum","_blank");
}
window.onLoad = bustOut;
</script>

Ditzy
30.01.2010, 15:40
Supertare.. Bravo Baieti! V-ati ales cu cate un multumesc de la mn ;)