ist ein einfaches LayerScript....
Da ich es eh kostenlos zur Verfügung stelle (und javascript eh leicht zu 'klauen' ist) kann ich es ja hier posten :
var itsLayered = {
LayerFrameID : 'itslayered_frame',
LayerFrameColor : 'blue', //blue, dark, darkblue, green, light, orange, red, yellow
iFrameURL : 'http://www.erik-mohr.de',
StartLayerTime : 1000,
MoveLayerTime : 2,
MoveLayerPixel : 4,
MoveLayerEndLeft : 200, //Layer ends, if MOVELAYERENDLEFT pixel are on the left of the Layer
OpenNewWindow : true,
OpenNewWindowUrl : 'http://www.erik-mohr.de',
start : function() {
itsLayered.makeLoad(window, 'load', itsLayered.init);
},
makeLoad : function(e, x, func) {
if(e.addEventListener) {
e.addEventListener(x, func, false);
} else if(e.attachEvent) {
e.attachEvent('on' + x, func);
}
},
init : function() {
itsLayered.create_layer();
window.setTimeout("itsLayered.show_layer()", itsLayered.StartLayerTime);
},
show_layer : function() {
intervalla = window.setInterval("itsLayered.move_layer()", itsLayered.MoveLayerTime);
},
move_layer : function() {
leftMargin = document.getElementById(itsLayered.LayerFrameID).style.left;
leftMargin = parseInt(leftMargin.substr(0, (leftMargin.length - 2)));
document.getElementById(itsLayered.LayerFrameID).style.left = (leftMargin+itsLayered.MoveLayerPixel) + 'px';
if(itsLayered.MoveLayerEndLeft < (leftMargin+itsLayered.MoveLayerPixel)) {
itsLayered.StopMoving();
}
},
StopMoving : function() {
clearInterval(intervalla);
},
//BUILD FRAME
create_layer : function () {
boxes = {
main : document.createElement('div'),
wrapper : document.createElement('div'),
top : document.createElement('div'),
bottom : document.createElement('div')
},
links = {
closeit : document.createElement('a'),
author : document.createElement('a')
},
spans = {
title : document.createElement('span'),
free : document.createElement('span'),
copyright : document.createElement('span')
}
iframe = document.createElement('iframe');
boxes.main.id = itsLayered.LayerFrameID;
boxes.main.style.left = '-640px';
boxes.main.style.width = '631px';
boxes.main.style.height = '468px';
boxes.main.style.position = 'fixed';
boxes.main.style.background = 'url(img/bg_' + itsLayered.LayerFrameColor + '.gif) no-repeat';
boxes.main.style.top = '100px';
boxes.main.style.padding = '5px';
boxes.main.style.color = '#FFFFFF';
boxes.main.style.fontFamily = 'Tahoma, Geneva, sans-serif';
boxes.main.style.fontSize = '12px';
boxes.wrapper.style.width = '600px';
boxes.wrapper.style.height = '460px';
boxes.wrapper.style.position = 'absolute';
boxes.wrapper.style.left = '13px';
boxes.wrapper.style.top = '10px';
boxes.main.appendChild(boxes.wrapper);
boxes.top.style.height = '27px';
boxes.top.style.width = '600px';
boxes.top.style.textAlign = 'right';
boxes.top.style.fontSize = '13px';
boxes.wrapper.appendChild(boxes.top);
links.closeit.href = '#';
links.closeit.onclick = function() { boxes.main.style.display = 'none'; if(itsLayered.OpenNewWindow==true) {window.open(itsLayered.OpenNewWindowUrl, '', 'type=fullWindow,fullscreen,scrollbars=yes');} };
links.closeit.innerHTML = 'Close';
links.closeit.style.color = '#FFFFFF';
boxes.top.appendChild(links.closeit);
iframe.style.width = '600px';
iframe.style.height = '400px';
iframe.src = itsLayered.iFrameURL;
boxes.wrapper.appendChild(iframe);
boxes.bottom.style.width = '600px';
boxes.bottom.style.textAlign = 'right';
boxes.bottom.style.marginTop = '3px';
boxes.wrapper.appendChild(boxes.bottom);
spans.title.innerHTML = 'ItsLayered 1.0 ';
boxes.bottom.appendChild(spans.title);
spans.free.innerHTML = '(free) ';
spans.free.style.fontSize = '9px';
boxes.bottom.appendChild(spans.free);
spans.copyright.innerHTML = ' - Copyright © 2011 - ';
boxes.bottom.appendChild(spans.copyright);
links.author.href = 'http://www.erik-mohr.de';
links.author.onclick = function() { window.open('http://www.erik-mohr.de', 'Erik Mohr'); return false; }
links.author.innerHTML = 'Erik Mohr Webdesign & Programmierung';
links.author.style.color = '#FFFFFF';
boxes.bottom.appendChild(links.author);
document.getElementsByTagName('body')[0].appendChild(boxes.main);
}
}
itsLayered.start();
Alles anzeigen