Jump to content

To create a Close button


dgbullar

Recommended Posts

HI everyone,This question may seem simple to most of you but I can't quite figure it out. So here it is:I want to have a window that will display an image and under the image will be a button that will close the window. How would I make the button close the window?I also want to create the button icon myself as opposed to using the browses default button, how would I insert my icon?Thanks for any help on this,David B

Link to comment
Share on other sites

You could use a regular link with an image in it:

<a href="#" onclick="CloseWindow();"><img src="theimage.gif" alt="Close" /></a><script type="text/javascript">function CloseWindow(){	// Can only close windows that have been opened by another window.	// So, you have to check to see it this window has an opener.	if(window.opener)	{		// It does, so let's close the window.		window.close();	}}</script>

Link to comment
Share on other sites

I have no idea if this works, but I found it in my HTML book I am learning from so I figured I would post it...

<form><input type='button' value='Close Window'onClick='self.close()'></form>

Sorry if this doesn't help at all,System

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...