View Full Version : close button
andy_jacko
November 26th, 2001, 14:05
I want to have a window that when a user clicks on a link pops-up and when they click a close image the screen closes. Iam assuming this is some sort of javascript please help.
Gonzo
November 26th, 2001, 20:29
<a href="Javascript:window.close()">Close Window</a>
Use that to close a window that you pop up.
andy_jacko
December 2nd, 2001, 07:19
How do I get the window to pop-up preferably without the address and tools bar at the top (I think this is possible).
thanks again
andy:)
Gonzo
December 2nd, 2001, 07:31
<script language="JavaScript">
window.open('URL', 'TITLE', 'toolbar,menubar,scrollbars,resizable,status,location,width= 100,height=200,')
</script>
Just replace URL and TITLE to what you want. if you want something out of there like the location just remove it form the code.
Jan
December 2nd, 2001, 07:31
Try this one http://www.codelifter.com/main/javascript/amazingframelesspopup1.html
Cyber
December 2nd, 2001, 08:11
does that work on macs though?
andy_jacko
December 2nd, 2001, 08:50
i know this may sound dumb to you guys but how is the script in gonzo's thread implemented in html i.e. where do I put it and what else do I have to put in my code to get it to work.
sorry about this but I am an newbie
Dusty
December 2nd, 2001, 10:59
<html>
<head>
<title>Page Title</title>
<script language="JavaScript">
<!--
function popUp(){
window.open('URL','TITLE','toolbar,menubar,scrollbars,resiza ble,status,location,width=100,height=200');
}
//-->
</script>
</head>
<body>
<form>
<input type="button" value="Click Me" onClick="popUp();">
</form>
</body>
</html>
andy_jacko
December 2nd, 2001, 14:28
cheers Dusty and everyone else that should do the trick.
I really should get round to learning javascript.
Again many thanks
regards andy:)
1st
December 2nd, 2001, 16:00
Like you are you just learned something. This is a great forum. If you want to learn it. Learn it when you need it as you just did.
Enjoy all...
andy_jacko
December 2nd, 2001, 17:26
sorry to be an idiot but I tried the code placing the required url in the correct place and I get errors on the page and the button doesn't load another window.
any clues
Dusty
December 2nd, 2001, 17:30
The forum must've broken this line into two sections:
window.open('URL','TITLE','toolbar,menubar,scrollbars,resiza ble,status,location,wi
dth=100,height=200');
They should be together. Is that your problem?
[edit]
And also it keeps adding a space between "window." and "open", it should be "window.open".
andy_jacko
December 2nd, 2001, 18:29
cheers dusty that sorted it
andy_jacko
December 3rd, 2001, 13:35
how do I have more than one button to open different pages. I think I will need to copy the script but alter the script name. Is thios correct if not how do I go about doing this.
[edit]
got it sorted just needed to copy the code and stick a 2 after popup in the javascript and call popup2() instead of popup() in the html
[edit]
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.