# Div Layer bei Klick auf Link öffnen



## rollerueckwaerts (16. Juni 2008)

Hallo liebe tutorials Gemeinde,
möchte auif meiner Seite ein paar Links einbauen die bei Klick nen div layer öffnen soll.
Da ich von javascript nich so die Ahnung und mich wegen den einen layer jetz nicht unbedingt javascript lernen mag, hab ich mir nen Code aus nem "Flash to DivLayer"- Generator auswerfen lassen.

Klappt auch perfekt, das Problem, der Code ist als StressWerbeLayer ausgelegt und öffnet bei jedem Seitenaufruf.

Leider nicht bei Linkklick 

Wi lässt sich das einfach machen ?

Achtung der Code is nen Stück länger .....


```
<div id="adops__BannerLayerAd" name="adops__BannerLayerAd"></div>
<script>
<!--
var adops__CreativesBase='http://192.130.0.145:8888/xsite/';
var adops__AdvertiserURL='';
// Flash File Infos
var adops__FlashFile='tester.swf';
var adops__VersionRequired=9;
var adops__FlashWidth=550;
var adops__FlashHeight=150;
var adops__FlashParamaters='clickTag=[YOUR_CLICK_TRACKER_HERE]' + escape('http://192.130.0.145:8888/xsite/insidearea.php') +'&';
// Backup Image Info
var adops__ImageFile='tester.jpg';
var adops__ImageWidth=750;
var adops__ImageHeight=150;
// Dont change anything bellow
// Flash plugin sniffer code
var adops__AllowFlash=0;
var adops__BackupImage=1;


with(navigator){var adops__plugin=(mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"])?mimeTypes["application/x-shockwave-flash"].enabledPlugin:0;if(adops__plugin){with(adops__plugin){adops__AllowFlash=(parseInt(description.substring(description.indexOf(".")-1))>=adops__VersionRequired)?1:0}}else 

if(userAgent){with(userAgent){if(indexOf("MSIE")>=0&&(indexOf("Windows 95")>=0||indexOf("Windows 98")>=0||indexOf("Windows NT")>=0)){document.write('<scr'+'ipt language="VBScript">\non error resume next\nadops__AllowFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+adops__VersionRequired+'")))<\/scr'+'ipt>')}}}}
// Update creatives url
if(adops__FlashFile!=''){adops__FlashFile=adops__CreativesBase+adops__FlashFile}else{adops__AllowFlash=0}
if(adops__ImageFile!=''){adops__ImageFile=adops__CreativesBase+adops__ImageFile;adops__BackupImage=1}else{adops__BackupImage=0}
// Create value of the adops__AdContent variable
var adops__AdContent='';
if(adops__AllowFlash){adops__AdContent+='<object id="adops__flash_object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+adops__FlashWidth+'" height="'+adops__FlashHeight+'"><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"><param name="movie" value="'+adops__FlashFile+'"><param name="FlashVars" value="'+adops__FlashParamaters+'"><param name=quality value="high"><embed name="adops__flash_object" src="'+adops__FlashFile+'" FlashVars="'+adops__FlashParamaters+'" width="'+adops__FlashWidth+'" height="'+adops__FlashHeight+'" swLiveConnect="true" quality="autohigh" type="application/x-shockwave-flash" allowScriptAccess="always"></embed></object>'}else{adops__AdContent+='<a href="[YOUR_CLICK_TRACKER_HERE]'+adops__AdvertiserURL+'" target="_new"><img src="'+adops__ImageFile+'" width="'+adops__ImageWidth+'" height="'+adops__ImageHeight+'" border="0"></a>'}
var adops__LayerContent=adops__AdContent;
var adops__LayerHeight=(adops__AllowFlash)?adops__FlashHeight:(adops__BackupImage)?adops__ImageHeight:0;
var adops__LayerWidth=(adops__AllowFlash)?adops__FlashWidth:(adops__BackupImage)?adops__ImageWidth:0;
var adops__isCentered=0;
var adops__isRelative=0;
var adops__isOpaque=0;
var adops__isFullcovering=0;
var adops__LayerLeft=510;
var adops__LayerTop=92;
var adops__LayerBackgroundColor='';
var adops__PreloadTimer;
var adops__KeepPositionTimer;
var adops__DisplayTimer;
function adops__KeepLayerPositionAndSize(_LayerName){
   with(document.body){
      adops__BrowserWidth=(navigator.appName=="Netscape")?innerWidth:(document.documentElement)?((document.documentElement.clientWidth)?document.documentElement.clientWidth:clientWidth):clientWidth;
      adops__BrowserHeight=(navigator.appName=="Netscape")?innerHeight:(document.documentElement)?((document.documentElement.clientHeight)?document.documentElement.clientHeight:clientHeight):clientHeight;
      if(adops__isFullcovering){
         adops__LayerHeight=adops__BrowserHeight+'px';
         adops__LayerWidth=adops__BrowserWidth+'px';
         style.overflow="hidden";

      }
      if(document.getElementById(_LayerName)!=null){
         with(document.getElementById(_LayerName).style){
            top=((adops__BrowserHeight-adops__LayerHeight)/2)+'px';
            left=((adops__BrowserWidth-adops__LayerWidth)/2)+'px';
            width=adops__LayerWidth+'px';
            height=adops__LayerHeight+'px';
            
         }
      }
      if(document.getElementById("adops__DhtmlTable")!=null){
         document.getElementById("adops__DhtmlTable").style.height=adops__LayerHeight+'px';
         
      }
   }
}
function adops__RefreshGif(){
   var adops__Images=document.getElementsByTagName('IMG');
   for(i=0;i<adops__Images.length;i++){
      if(adops__Images[i].src.toLowerCase().lastIndexOf('.jpg')<0 || adops__Images[i].src.toLowerCase().lastIndexOf('.jpeg')<0){
         adops__Images[i].src=adops__Images[i].src;
         
      }
   }
}
function adops__CloseLayerAd(){
   clearInterval(adops__KeepPositionTimer);
   clearTimeout(adops__DisplayTimer);
   with(document){
      getElementById("adops__DhtmlLayer").innerHTML='';
      getElementById("adops__DhtmlLayer").parentNode.removeChild(getElementById("adops__DhtmlLayer"));
      with(body.style){
         zIndex=10000;
         visibility="visible";
      }
   }
   adops__RefreshGif();
}
function adops__CreateNewLayer(_LayerName,_Width,_Height,_innerHTML,_BackGroundColor){
   if(document.getElementById(_LayerName)==null){
      var _newLayer=document.createElement('DIV');
      var _newParentLayer=document.createElement('DIV');
      
      with(document.body){
         adops__BrowserWidth=(navigator.appName=="Netscape")?innerWidth:(document.documentElement)?((document.documentElement.clientWidth)?document.documentElement.clientWidth:clientWidth):clientWidth;
         adops__BrowserHeight=(navigator.appName=="Netscape")?innerHeight:(document.documentElement)?((document.documentElement.clientHeight)?document.documentElement.clientHeight:clientHeight):clientHeight;
   
   }
      with(_newLayer){
         id="adops__DhtmlLayer";
          with(style){
            width=_Width+'px';
            height=_Height+'px';
            position="absolute";
            overflow="hidden";
            zIndex=2000010;
            left=-_Width+'px';
            top=-_Height+'px';
            textAlign='left';
            visibility="hidden";

         }
      }
      with(document.body){
         if(adops__isRelative){
            document.getElementById("adops__BannerLayerAd").appendChild(_newLayer);
         }
         else{
            insertBefore(_newLayer,firstChild);
         }
      }
      tmpHTML='<div style="position:absolute;top:0px;left:0px;z-Index:2000010;width:100%;height:100%;text-Align:left"><iframe marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no src="about:blank" style="width:100%;height:100%;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe></div>';
      tmpHTML+='<div style="position:absolute;top:0px;left:0px;z-Index:2000020;width:100%;height:100%;text-Align:left"><table style="width:100%;height:100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center">'+_innerHTML+'</td></tr></table></div>';
      _newLayer.innerHTML=tmpHTML;
   }
}
function adops__Start(){
   adops__CreateNewLayer("adops__DhtmlLayer",adops__LayerWidth,adops__LayerHeight,adops__LayerContent,adops__LayerBackgroundColor);
   if(adops__isCentered){
      adops__KeepPositionTimer=setInterval('adops__KeepLayerPositionAndSize("adops__DhtmlLayer")',10);
   }
   else{
      with(document.getElementById("adops__DhtmlLayer").style){
         top=adops__LayerTop+'px';
         left=adops__LayerLeft+'px';
      }
   }
   adops__DisplayTimer=setTimeout('adops__CloseLayerAd()',1000000*1000);
}
// Avoiding multilayers overlapping each other
if(typeof(adlAvoidOverLapping)=='undefined'){
   var adlAvoidOverLapping=true;
   if(window.attachEvent){
      window.attachEvent("onload",adops__Start);
   }
   else{
      window.addEventListener("load", adops__Start, false);
   }
}
// Additionnal code for OVK compliant dhtml flash
function adops__flash_object_DoFSCommand(command, args){if(command=="adlayerhider"){adops__CloseLayerAd()}}
document.write('<scr'+'ipt language="VBScript">\non error resume next\nSub adops__flash_object_FSCommand(ByVal command, ByVal args)\ncall adops__flash_object_DoFSCommand(command, args)\nend sub\n<\/scr'+'ipt>');
//-->
</script>
```

Wär echt supi wenn es jemanden gibt der das mit einen blick das hinbekommt und mir dabei helfen könnten.

Lg
Tob


----------



## Sven Mintel (17. Juni 2008)

Keine Ahnung von Javascript

Nix für ungut, aber du gehst sicher auch nicht in den Supermarkt, und erwartest ein Tutorial zur Bedienung des Einkaufswagens... ein klein wenig Selbstinitative empfinde ich nicht als zu  Viel verlangt....und damit meine ich nicht, hier irgendeinen Code hinzuballern, der mal bitte angepasst werden soll.


----------

