slapshotMedlem sedan jan. 2003141 inlägg <script type="text/javascript">
function openPopup(url, name, height, width) {
window.open(url, name, "channelmode=no, directories=no, fullscreen=no,"
+ " height=" + height + ", location=no, menubar=no,"
+ " resizable=no, scrollbars=no, status=no, width=" + width
+ ", left= " + (screen.width-width)/2) + ", top= " + (screen.height-height)/2) ;
}
</script>
<a href="fil.asp" onclick='openPopup(this.href, "fil", 220, 250); return false;'>
fil</a>
Om jag vill ha en popup från en annan mapp, hur skriver man då? Om det nu går med detta?
Hmmm, jag kanske missförstår dig helt nu, men du anger sökvägen till filen du ska öppna i a-taggen:
<a href="minMapp/fil.asp" onclick='openPopup(this.href, "fil", 220, 250); return false;'>fil</a>
Men det kanske inte alls är det du frågar efter?
slapshotMedlem sedan jan. 2003141 inlägg Men detta scriptet verkar icke funka så, får du det att funka?
Jodå, det fungerar så. Men du har en liten parantesfuling för mycket i din funktion ser jag nu. ..
<script type="text/javascript">
function openPopup(url, name, height, width) {
window.open(url, name, "channelmode=no, directories=no, fullscreen=no,"
+ " height=" + height + ", location=no, menubar=no,"
+ " resizable=no, scrollbars=no, status=no, width=" + width
+ ", left= " + (screen.width-width)/2 + ", top= " + (screen.height-height)/2) ;
}
</script>