20. januar 2004 - 13:07
Der er
5 kommentarer og 1 løsning
Placering på popup
Hej eksperter Jeg har dette script: <script language="javascript" type="text/javascript"> function popWin(file){ newWin=window.open("","ResizeBillede","width=300,height=200, status=no"); txt = '<ht'+'ml><he'+'ad><ti'+'tle>Resize til billede<\57ti'+'tle><scri'; txt += 'pt language="javascript" type="text/javascript">'; txt += 'function resPic(){h=document.images[0].scrollHeight;'; txt += 'w=document.images[0].scrollWidth;window.resizeTo(w+6,h+32);}<\57scri'; txt += 'pt><\57he'+'ad><bo'+'dy style="overflow:hidden;'; txt += 'border:0px;margin:0px"><i'+'mg src="'+file+'" style="top:0px;left:0px;border:0px;'; txt += '" onload="resPic();"><\57bo'+'dy><\57ht'+'ml>'; newWin.document.write(txt); newWin.document.close(); } popWin("hane2.jpg"); </script> Hvordan kan jeg få den til at poppe op midt på skærmen. -KAHS
Annonceindlæg tema
Cloud & AI
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
20. januar 2004 - 13:10
#1
Brug dette script: <script type="text/JavaScript"> <!-- function displayWindow(theURL,winName,width,height,features) { var window_width = width; var window_height = height; var newfeatures= features; var window_top = (screen.height-window_height)/2; var window_left = (screen.width-window_width)/2; newWindow=window.open(''+ theURL + '',''+ winName + '','width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ',features=' + newfeatures + ''); newWindow.focus(); } //--> </script> //>Rune
20. januar 2004 - 13:10
#2
<script language="javascript" type="text/javascript"> function popWin(file){ pos_horizon = ((screen.width/2)-(win_width/2)); pos_vertical = ((screen.height/2)-(win_height/2)); newWin=window.open("","ResizeBillede","width=300,height=200, top="+pos_vertical+",left="+pos_horizon+",status=no"); txt = '<ht'+'ml><he'+'ad><ti'+'tle>Resize til billede<\57ti'+'tle><scri'; txt += 'pt language="javascript" type="text/javascript">'; txt += 'function resPic(){h=document.images[0].scrollHeight;'; txt += 'w=document.images[0].scrollWidth;window.resizeTo(w+6,h+32);}<\57scri'; txt += 'pt><\57he'+'ad><bo'+'dy style="overflow:hidden;'; txt += 'border:0px;margin:0px"><i'+'mg src="'+file+'" style="top:0px;left:0px;border:0px;'; txt += '" onload="resPic();"><\57bo'+'dy><\57ht'+'ml>'; newWin.document.write(txt); newWin.document.close(); }
20. januar 2004 - 13:11
#3
<script language="javascript" type="text/javascript"> function popWin(file){ var window_width = width; var window_height = height; var window_top = (screen.height-window_height)/2; var window_left = (screen.width-window_width)/2; newWin=window.open("","ResizeBillede","width="+window_width+",height="+window_height+", status=no"); txt = '<ht'+'ml><he'+'ad><ti'+'tle>Resize til billede<\57ti'+'tle><scri'; txt += 'pt language="javascript" type="text/javascript">'; txt += 'function resPic(){h=document.images[0].scrollHeight;'; txt += 'w=document.images[0].scrollWidth;window.resizeTo(w+6,h+32);}<\57scri'; txt += 'pt><\57he'+'ad><bo'+'dy style="overflow:hidden;'; txt += 'border:0px;margin:0px"><i'+'mg src="'+file+'" style="top:0px;left:0px;border:0px;'; txt += '" onload="resPic();"><\57bo'+'dy><\57ht'+'ml>'; newWin.document.write(txt); newWin.document.close(); } popWin("hane2.jpg"); </script> sådan vil det se ud med dit eget! //>Rune
20. januar 2004 - 13:12
#4
<script language="javascript" type="text/javascript"> function popWin(file){ var window_width = width; var window_height = height; var window_top = (screen.height-window_height)/2; var window_left = (screen.width-window_width)/2; newWin=window.open("","ResizeBillede","width="+window_width+",height="+window_height+" top=" + window_top + ",left=" + window_left + ", status=no"); txt = '<ht'+'ml><he'+'ad><ti'+'tle>Resize til billede<\57ti'+'tle><scri'; txt += 'pt language="javascript" type="text/javascript">'; txt += 'function resPic(){h=document.images[0].scrollHeight;'; txt += 'w=document.images[0].scrollWidth;window.resizeTo(w+6,h+32);}<\57scri'; txt += 'pt><\57he'+'ad><bo'+'dy style="overflow:hidden;'; txt += 'border:0px;margin:0px"><i'+'mg src="'+file+'" style="top:0px;left:0px;border:0px;'; txt += '" onload="resPic();"><\57bo'+'dy><\57ht'+'ml>'; newWin.document.write(txt); newWin.document.close(); } popWin("hane2.jpg"); </script> Sådan er det vidst! //>Rune
20. januar 2004 - 13:19
#5
To løsninger, snippet lidt sammen fra forskellige løsninger if (navigator.userAgent.indexOf("MSIE") > 0) { W = document.body.clientWidth; H = document.body.clientHeight; } else { W = window.outerWidth; H = window.outerHeight; } top = (H-200)/2; left = (W-300)/2; newWin=window.open("","ResizeBillede","width=300,height=200,top="+top+",left="+left+",status=no"); eller i selve popup'en kan du lave ala var NS = document.all; if(!NS) { self.moveTo((self.screen.width - self.outerWidth) / 2, (self.screen.height - self.outerHeight) / 2); } else { self.moveTo((self.screen.width-document.body.clientWidth) / 2, (self.screen.height-document.body.clientHeight) / 2); } self.focus();
20. januar 2004 - 15:30
#6
Du mener så ik' vi begge skal ha' points? //>Rune
Vi tilbyder markedets bedste kurser inden for webudvikling