PDA

View Full Version : image popup with javascript



Glen_S
04-10-2010, 09:53 PM
I have been playing with the "konami" script to put an "easter egg" on some of my sites. I have it working so it will open a new page, but what I would like to do is have it pop up an image over the current page. I have tried the following but can't get it to work (I know very little about javascript programming)

<script type="text/javascript" src="js/konami.js"></script>
<script type="text/javascript">
konami.code = function() {
window.open(images/image1.jpg','mywin','width=800,height=600,left=0,top=100')
}
</script>


This works to get it to open a new page:

<script type="text/javascript" src="js/konami.js"></script>

<script type="text/javascript">
konami = new Konami()
konami.load("spoof.php");
</script>

but I can't get it to pop up an image window. I know I am doing this incorrectly somehow, hoping someone here can point it out to me.

While I am here and thinking about it, I could also accomplish the same thing by combining a key-press with a mouseover or mouseclick - would it be possible to modify one of the mouseover image changing javascripts so this could be done? I was thinking about this script (http://www.dynamicdrive.com/dynamicindex15/domroll.htm)..

thanks in advance