Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
How do I change a BG image for a div onclick?
Old 04-20-2004, 06:57 PM How do I change a BG image for a div onclick?
Junior Talker

Posts: 3
Trades: 0
if i have a DIV class with a background picture (div.background), and i would like to make a link to swap that picture, would this be correct:
<a href="#" onClick="this.style.background='white url(bg04.jpg) no-repeat'">

Its not working, and i cannot figure out why, you can see it here:
http://www.brycepetit.com/test.html

any help would be much appreciated
brycepetit is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-20-2004, 07:38 PM
Junior Talker

Posts: 3
Trades: 0
nevermind, i dont know what i was thinking.
all i had to do was give the div class an ID and modify the eventhandler:

<div class="background" id="swap">
<a href="#" onClick="getElementById('swap').style.background=' white url(http://www.brycepetit.com/bg04.jpg) no-repeat';">
brycepetit is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How do I change a BG image for a div onclick?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16850 seconds with 12 queries