nameos Posted July 1, 2006 Share Posted July 1, 2006 I need help with my webiste on html.What I want to do is make a button(which I have) and when you click on the button it opens a new windo, but more like a POPUP like a small window like a announcement.kinda like thisRIGHT HEREwhen u click on the first linkexcept I want it to work for a image Link to comment Share on other sites More sharing options...
Chocolate570 Posted July 1, 2006 Share Posted July 1, 2006 Just use this code:<script type="text/javascript">function openWin(url) {window.open(url,"window","menubar=1,resizable=0,width=100,height=100");}</script><a href="#" onclick="openWin(yoururl)">Open new Window!</a> Link to comment Share on other sites More sharing options...
nameos Posted July 1, 2006 Author Share Posted July 1, 2006 were would I put this? Link to comment Share on other sites More sharing options...
Chocolate570 Posted July 1, 2006 Share Posted July 1, 2006 Put the javascript part in the <head> section and the <a href=""> part wherever you want the link that opens the pop up to be. Link to comment Share on other sites More sharing options...
smiles Posted July 1, 2006 Share Posted July 1, 2006 Put the javascript part in the <head> sectionor in the <body> if you don't want to see a seldom problem with loading Link to comment Share on other sites More sharing options...
nameos Posted July 1, 2006 Author Share Posted July 1, 2006 yeahthats cool and all but how do u get it to be worked into a image. Iwant it so when u click a image it does that. Link to comment Share on other sites More sharing options...
smiles Posted July 1, 2006 Share Posted July 1, 2006 <body><form><input type="image" src ="your image 's link"></form> </body> Link to comment Share on other sites More sharing options...
scott100 Posted July 1, 2006 Share Posted July 1, 2006 yeahthats cool and all but how do u get it to be worked into a image. Iwant it so when u click a image it does that.<{POST_SNAPBACK}> Instead of this:<a href="#" onclick="openWin(yoururl)">Open new Window!</a>Use this:<img src="xxx.jpg" onclick="openWin(yoururl)" />xxx.jpg = the path to your image. Link to comment Share on other sites More sharing options...
janzwaantje Posted July 1, 2006 Share Posted July 1, 2006 orUse this:<button onclick="openWin(yoururl)">Hello</button> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now