RSS Forums RSS
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Drop down menu with images

Join Date: Jun 2006
Location: India
Posts: 7,174
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 26
Solved Threads: 396
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Drop down menu with images

  #5  
Jun 18th, 2007
> sorry what i meant was i dont believe you can change a
> background image via javascript. my bad

Something like this;
  1. <html>
  2. <head>
  3. <script>
  4. function changeOver(id)
  5. {
  6. var elem = document.getElementById(id);
  7. elem.style.backgroundImage = "url(submit.gif)";
  8. elem.style.cursor = 'pointer';
  9. elem.style.cursor = 'hand';
  10. }
  11. function changeOut(id)
  12. {
  13. var elem = document.getElementById(id);
  14. elem.style.backgroundImage = "url(search.gif)";
  15. }
  16. </script>
  17. </head>
  18. <body>
  19. <span style="background-image: url(search.gif); color: white;" id="myP" onmouseout="changeOut(this.id);" onmouseover="changeOver(this.id);">
  20. Hello to all of you. This text is white
  21. </span>
  22. </body>
  23. </html>
Attached Images
File Type: gif search.gif (950 Bytes, 31 views)
File Type: gif submit.gif (2.9 KB, 30 views)
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:46 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC