Jump to content

making a button popup


nameos

Recommended Posts

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

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

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

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.

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...