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.

JavaScript Forum


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



Reply
Div bg image change with onmouseout?
Old 02-09-2007, 02:43 PM Div bg image change with onmouseout?
futurevisions's Avatar
Super Talker

Posts: 102
Location: UK
Trades: 0
I'm not sure how best to go about it, but I need the background image of a div to change onmouseout - can anyone help?

Thanks
futurevisions is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-09-2007, 03:17 PM Re: Div bg image change with onmouseout?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Hook your javascript code into the onmouseout event, and set it to change the background image of that div. I'm not sure where you're having trouble? Give the div an id, and then use document.getElementById to manipulate it.
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 02-09-2007, 04:31 PM Re: Div bg image change with onmouseout?
futurevisions's Avatar
Super Talker

Posts: 102
Location: UK
Trades: 0
I've never really coded Javascript that much.

You could say I'm asking if someone could give me the code for it! If it's not too complicated, that is. I'd be very grateful for any help.
futurevisions is offline
Reply With Quote
View Public Profile
 
Old 02-09-2007, 09:30 PM Re: Div bg image change with onmouseout?
vn5ltr's Avatar
Skilled Talker

Posts: 93
Location: Melbourne, Australia
Trades: 0
Here you go:

Code:
<html>
<head>
<title>example</title>
<script type="text/javascript">
function imagechange(element)
{
bgimage = 'url(something.gif)';
document.getElementById(element).style.backgroundImage = bgimage;
}
</script>
</head>
<html>
<body>
<div id="example" style="height:200px; width:200px; background-color:#000000" onclick="imagechange(this.id);">&nbsp;</div>
</body>
</html>
Cheers.
vn5ltr is offline
Reply With Quote
View Public Profile
 
Old 02-16-2007, 10:47 AM Re: Div bg image change with onmouseout?
Mathan Kumar's Avatar
Junior Talker

Posts: 2
Name: Mathan Kumar
Trades: 0
hi every body any one can tell me how change the mouse pointer in our own icons
this is my mail id.if you known that answer please send mail to this id Radomathan@gmail.com thank you
__________________
S.S.Mathan Kumar
Mob No:- 09899005055
Mathan Kumar is offline
Reply With Quote
View Public Profile
 
Old 02-16-2007, 10:03 PM Re: Div bg image change with onmouseout?
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
Quote:
Originally Posted by Mathan Kumar View Post
hi every body any one can tell me how change the mouse pointer in our own icons
this is my mail id.if you known that answer please send mail to this id Radomathan@gmail.com thank you
Check out: http://www.w3schools.com/css/pr_class_cursor.asp
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 02-20-2007, 06:06 AM Re: Div bg image change with onmouseout?
Novice Talker

Posts: 11
Name: Matthew Bagley
Trades: 0
<div onmouseover="this.style.backgroundImage = 'url(theimage.jpg)';">

then to remove the background on mouse out you would do

<div onmouseout="this.style.backgroundImage = 'url(original.jpg)';">

hope that helps
__________________
Matthew Bagley
Paramiliar Design Studios

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
neomaximus2h is offline
Reply With Quote
View Public Profile Visit neomaximus2h's homepage!
 
Reply     « Reply to Div bg image change with onmouseout?
 

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 1.39570 seconds with 12 queries