DREAMBUILDS Posted September 7, 2010 Report Posted September 7, 2010 Hello to experts. I have one problem: There are few buttons on the site and I need code for them, when one button is clicked to stay at this point ( pressed look with different color )and when other is clicked, first one is back in his normal state and this second is clicked with this second color ( another button image ). Can you help me somehow? Thank you very much in advance. regards, DREAMBUILDS Quote
sarina28 Posted September 7, 2010 Report Posted September 7, 2010 If you're using dreamweaver, in the menu go to insert -> image objects -> rollover image. Just select the two images, and the code will be inserted for you. Or go to: http://javascriptkit.com/mousewhipper/index.htm It will tell you where to insert your code. Quote
DREAMBUILDS Posted September 7, 2010 Author Report Posted September 7, 2010 If you're using dreamweaver, in the menu go to insert -> image objects -> rollover image. Just select the two images, and the code will be inserted for you. Or go to: http://javascriptkit.com/mousewhipper/index.htm It will tell you where to insert your code. Thank you, I already did that, but the point is that I want menu button to stay down ( showing rollower image ) on press and do not move from this position until I press another button. This is the mystery to me... Quote
sarina28 Posted September 8, 2010 Report Posted September 8, 2010 I've only used 2 stage javascript buttons. If you know css, then I would suggest using image sprites. It uses one image, but with all 3 states in the same image. The css positions the part of the image in a viewable area for the given state. This article will show you how. http://www.alistapart.com/articles/sprites/ Quote
DREAMBUILDS Posted September 9, 2010 Author Report Posted September 9, 2010 I've only used 2 stage javascript buttons. If you know css, then I would suggest using image sprites. It uses one image, but with all 3 states in the same image. The css positions the part of the image in a viewable area for the given state. This article will show you how. http://www.alistapart.com/articles/sprites/ Thank you, I will try with css. Quote
Wickham Posted September 9, 2010 Report Posted September 9, 2010 If your buttons are links to other pages, it sounds as if you want the "current page" code where the current page button is different until you click another button to go to another page. See http://www.wickham43.net/highlighthome.php the third item where button images have been used. I could have used sprites but didn't there. The main reason for using sprites is to avoid a flash in the display on hover while a new image is downloaded. A sprite just moves the position of an image so that another part of a combined image shows without a flash. In my example I didn't need sprites because the display will flash anyway when moving to another page, but would have helped if I also wanted a different image on hover. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.