[RESOLVED] Popup help
Hi I have dowloaded a simple popup script which in itself works fine, however because I am opening an image directly and not opening a html file the image location is displayed on top of the popup window.
Is it posibe to include in the popup script some like <title>My heading</title>?
HTML Code:
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page1" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=400,left = 0,top = 0');");
}
Thanks so much as always.
Don't use eval
Code:
function popUp(URL) {
day = new Date();
id = day.getTime();
window["page1" + id] = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=400,left = 0,top = 0');
window["page1" + id].onload=function() {setTimeout(function(){window["page1" + id].document.title="My heading";}, 1000 );}; // wait for page to load
}
At least 98% of internet users' DNA is identical to that of chimpanzees
hi
Thanks so much for the reply but did you miss anything off or do something wrong as it does not work at all now?
Also I call it like this;
<a href="javascript opUp('123.gif')">File name</a>
Any ideas?
Thanks again.
Changed to allow for IE:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script type="text/javascript">
function popUp(URL) {
day = new Date();
id = day.getTime();
window["page1" + id] = window.open(URL, id, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=400,left=0,top=0');
}
function changeHeading() {
window["page1" + id].document.title="My heading";
}
</script>
<style type="text/css">
* {margin:0;padding:0;}
</style>
</head>
<body>
<div><a href="123.gif" alt="image info" onclick="popUp(this.href); changeHeading(); return false;">ajax</a></div>
</html>
At least 98% of internet users' DNA is identical to that of chimpanzees
Excellent worked erfectly.
Thanks so much.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks