Reklama Flash - rozwijający się baner po najechaniu na stronie [AS + JS]
Skrypt wyświetla najpierw miniaturkę filmu flash potem się rozwija w odpowiednim kierunku.
Opis zmiennych:
mw - minimalna szerokość
mh - minimalna wysokość
ww - maksymalna szerokość
hh - maksymalna wysokość
targetURL - adres do przekierowania po kliknięciu
miogif - alternatywny obrazek
Kreacja powinna mieć aktywny obszar na całej swojej powierzchni oraz przez cały czas emisji (w stanie zwiniętym oraz w stanie rozwiniętym)
z poniższym dowiązaniem dla przycisku:
on (rollOver)
{
getURL(_root.doexpand,"_self");
}
on (rollOut)
{
getURL(_root.dolittle,"_self");
}
Listing
<!-- expand new -->
<script language="JavaScript">
<!--
var mw = 750;
var mh = 100;
var ww = 750;
var hh = 300;
var psmtype ='down'; // w ktora strone ma sie rozwijać left, right, down
var targetURL = "http://www.adnet.pl";
var redirect = "";
var bioflash = "http://dc1.sabela.pl/files/kod/examples/expandbilboard.swf";
var miogif = "http://dc.sabela.pl/files/Canal_ZigZap/expandskyscraper_160x600_v1.gif";
var plugin = false;
var d589 = document;
var fappVer = parseFloat(navigator.appVersion);
var targetie = (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)&&(navigator.userAgent.indexOf('Opera')==-1)&&(navigator.appName != 'Netscape')&&(navigator.userAgent.indexOf('MSIE') > -1)&&(fappVer >=4);
if (targetie){
d589.write('<SCRIPT LANGUAGE=VBScript\> \n');
d589.write('on error resume next \n');
d589.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
d589.write('<\/SCRIPT\> \n');
if (plugin){
d589.write('<table width="'+mw+'" height="'+mh+'" cellpadding=0 cellspacing=0><tr><td><div id="mio" style="visibility :hidden;">');
d589.write('<img src="http://dc.sabela.pl/files/ps_test/1x1.gif" width="'+mw+'" height="'+mh+'" border=0>');
d589.write('</div></td></table>');
d589.write('<div id="bio" style="position : absolute; left : 0; top : 0; width : '+ww+'; height : '+hh+'; visibility :hidden; z-index:100">');
d589.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ID=bioflash WIDTH='+ww+' HEIGHT='+hh+'><PARAM NAME=movie VALUE="'+bioflash+'?dolittle=javascript:dolittle2()&doexpand=javascript:doexpand2()&clickTag='+redirect+escape(targetURL)+'"> <PARAM NAME=quality VALUE=high> </OBJECT>');
d589.write('</div>');
function SetLayerVis(spritename,state){
d589.all[spritename].style.visibility=state;
}
function SetLayerPos(spritename,left,top){
d589.all[spritename].style.top=top;
d589.all[spritename].style.left=left;
}
function SetLayerRight(spritename)
{
var Lleft;
var Ltop;
Lleft = slx('mio');
if ( psmtype=='left')
Lleft+=- ww + mw ;
Ltop = sly('mio') ;
SetLayerPos(spritename,Lleft,Ltop);
}
function slx(objname){
var obj = d589.all(objname);
var tmp = 0;
while (obj.offsetParent != null) {
if (obj.style.position=='absolute')
break;
tmp += obj.offsetLeft;
obj = obj.offsetParent;
if (obj.tagName == 'BODY') break;
} return tmp;
}
function sly(objname){
var obj = d589.all(objname);
var tmp = 0;
while (obj.offsetParent != null) {
if (obj.style.position=='absolute')
break;
tmp += obj.offsetTop;
obj = obj.offsetParent;
if (obj.tagName == 'BODY') break;
} return tmp;
}
function dolittle2()
{
if (psmtype=='left')
document.all['bio'].style.clip = "rect(0,"+ww+","+mh+","+(ww-mw)+")";
else
document.all['bio'].style.clip = "rect(0,"+mw+","+mh+",0)";
}
function doexpand2()
{
document.all['bio'].style.clip = "rect(0,"+ww+","+hh+",0)";
}
dolittle2();
setTimeout("SetLayerRight('bio')",900);
setTimeout("SetLayerVis('bio','visible');",1000);
setInterval("SetLayerRight('bio');",150);
}
}
else
{
d589.write('<a href="'+redirect+targetURL+'" target=_blank><img src="'+miogif+'" border=0 width='+mw+' height='+mh+'></a>');
}
//-->
</script>
<script language="JavaScript">
<!--
var mw = 750;
var mh = 100;
var ww = 750;
var hh = 300;
var psmtype ='down'; // w ktora strone ma sie rozwijać left, right, down
var targetURL = "http://www.adnet.pl";
var redirect = "";
var bioflash = "http://dc1.sabela.pl/files/kod/examples/expandbilboard.swf";
var miogif = "http://dc.sabela.pl/files/Canal_ZigZap/expandskyscraper_160x600_v1.gif";
var plugin = false;
var d589 = document;
var fappVer = parseFloat(navigator.appVersion);
var targetie = (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)&&(navigator.userAgent.indexOf('Opera')==-1)&&(navigator.appName != 'Netscape')&&(navigator.userAgent.indexOf('MSIE') > -1)&&(fappVer >=4);
if (targetie){
d589.write('<SCRIPT LANGUAGE=VBScript\> \n');
d589.write('on error resume next \n');
d589.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
d589.write('<\/SCRIPT\> \n');
if (plugin){
d589.write('<table width="'+mw+'" height="'+mh+'" cellpadding=0 cellspacing=0><tr><td><div id="mio" style="visibility :hidden;">');
d589.write('<img src="http://dc.sabela.pl/files/ps_test/1x1.gif" width="'+mw+'" height="'+mh+'" border=0>');
d589.write('</div></td></table>');
d589.write('<div id="bio" style="position : absolute; left : 0; top : 0; width : '+ww+'; height : '+hh+'; visibility :hidden; z-index:100">');
d589.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ID=bioflash WIDTH='+ww+' HEIGHT='+hh+'><PARAM NAME=movie VALUE="'+bioflash+'?dolittle=javascript:dolittle2()&doexpand=javascript:doexpand2()&clickTag='+redirect+escape(targetURL)+'"> <PARAM NAME=quality VALUE=high> </OBJECT>');
d589.write('</div>');
function SetLayerVis(spritename,state){
d589.all[spritename].style.visibility=state;
}
function SetLayerPos(spritename,left,top){
d589.all[spritename].style.top=top;
d589.all[spritename].style.left=left;
}
function SetLayerRight(spritename)
{
var Lleft;
var Ltop;
Lleft = slx('mio');
if ( psmtype=='left')
Lleft+=- ww + mw ;
Ltop = sly('mio') ;
SetLayerPos(spritename,Lleft,Ltop);
}
function slx(objname){
var obj = d589.all(objname);
var tmp = 0;
while (obj.offsetParent != null) {
if (obj.style.position=='absolute')
break;
tmp += obj.offsetLeft;
obj = obj.offsetParent;
if (obj.tagName == 'BODY') break;
} return tmp;
}
function sly(objname){
var obj = d589.all(objname);
var tmp = 0;
while (obj.offsetParent != null) {
if (obj.style.position=='absolute')
break;
tmp += obj.offsetTop;
obj = obj.offsetParent;
if (obj.tagName == 'BODY') break;
} return tmp;
}
function dolittle2()
{
if (psmtype=='left')
document.all['bio'].style.clip = "rect(0,"+ww+","+mh+","+(ww-mw)+")";
else
document.all['bio'].style.clip = "rect(0,"+mw+","+mh+",0)";
}
function doexpand2()
{
document.all['bio'].style.clip = "rect(0,"+ww+","+hh+",0)";
}
dolittle2();
setTimeout("SetLayerRight('bio')",900);
setTimeout("SetLayerVis('bio','visible');",1000);
setInterval("SetLayerRight('bio');",150);
}
}
else
{
d589.write('<a href="'+redirect+targetURL+'" target=_blank><img src="'+miogif+'" border=0 width='+mw+' height='+mh+'></a>');
}
//-->
</script>
Dodano przez: divix
Ranga: Administrator serwisu Punktów: 0
Ranga: Administrator serwisu Punktów: 0
Komentarze użytkowników
:: Losowe artykuły
:: Wymiana linków
Modowe inspiracje |
Android Gry i Aplikacje |
ZaplanujTransport.pl: Przeprowadzki, transport, aukcje |
Logo dla firmy |
Change Tires - Car Weather Forecast Reminder |
Laminas: MVC Framework for PHP |
IT Books Reviews and Programming: JS, JAVA, PHP, ANDROID, CSS |
Katalog roślin |
Programming articles: JAVA, PHP, C++, Python, JavaScript |
Kancelaria Adwokacka Łukasz Huszno