Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to load a image in a popup window when page loads 1

Status
Not open for further replies.

IAMINFO

MIS
Feb 21, 2002
62
US
Hello everyone;

I have a hyperlink that opens a popup window and displays a image.

I would like to load the image automatically in a seperate popup window, when the page loads without clicking the hyperlink.

I am not sure what I need to do at this point. Hopefully I might receive some suggestions. Thank you for taking the time to read this post. Thanks again




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
//-->
</SCRIPT>

<A
HREF="c:\thumbnail.jpg"
onClick="return popup(this, 'notes')">my popup</A>
 
Code:
window.onload = function() {
   popup('[URL unfurl="true"]http://www.google.co.uk/',[/URL] 'notes');
};

But be warned - a lot of browsers will block popups that are not user-instigated.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top