Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-05-2010, 04:02 PM   #1
Daemon Poster
 
Join Date: May 2009
Posts: 690
Default rollover help

I am going to make a rollover image with JavaScript but then I saw on the net you can do it with CSS.

It loads all the images at one time and then goes through them wen the mouse is over it.

Thy say make all your images in one a Sprite.

But what is this and is it easyer and is there onother way??
__________________

biferi is offline   Reply With Quote
Old 03-05-2010, 05:29 PM   #2
In Runtime
 
ohm55's Avatar
 
Join Date: Feb 2010
Posts: 141
Default Re: rollover help

Oh. My. God.

How many times have you asked questions like this!?! Just use Javascript, there is no difference! A guy gave you perfectly fine code to use!
__________________

__________________
You are such a good friend that if you and me were the last two people trapped on a sinking boat with only 1 life vest left, i would remember and pray for you every day.
Funny how Communism is so bad in Politics but so good with software!
My reputation is in the Red, so why doesnt it say "ohm55 needs rehab" when I put my mouse over it?
ohm55 is offline   Reply With Quote
Old 03-05-2010, 05:58 PM   #3
In Runtime
 
hockeygoalie5's Avatar
 
Join Date: Dec 2009
Location: United States
Posts: 297
Default Re: rollover help

I agree my code is perfectly good to use. However if you wish to use CSS, here you go:

Place this between <head></head> tags:
Code:
<style type="text/css">
#img {
background-image:url('PATH/TO/IMAGE1.gif);
}
#img:hover {
background-image:url('PATH/TO/IMAGE2.gif);
}
</style>
Place this within the <body></body> tags where you want the image to be:
Code:
<div id="img"></div>
There you go, just please stop double posting threads. This question could have been asked within the same thread.
hockeygoalie5 is offline   Reply With Quote
Old 03-05-2010, 08:32 PM   #4
Omnicide now.
 
foothead's Avatar
 
Join Date: May 2009
Location: My own personal hell
Posts: 10,014
Default Re: rollover help

Quote:
Originally Posted by biferi View Post
Thy say make all your images in one a Sprite
What is this I don't even...
foothead is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 11:48 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0