Featured Worklog

Price Search



PC Apex Sponsor


PC Apex Sponsors



PC Apex RSS Feeds

RSS Feed for PC Apex Reviews & ArticlesRSS Feed for PC Apex PC Modding WorklogsRSS Feed for the PC Apex Daily DisturbanceRSS Feed for the latest PC Apex Site NewsRSS Feed for PC Apex Affiliate and Web NewsRSS Feed for PC Apex Deals and Steals

Go Back   Apex Community Forums // Other Forums // Designers Corner // Coding / Scripting / Programming

Coding / Scripting / Programming Discussions on all manner of coding and scripting.

Reply
 
LinkBack Thread Tools Display Modes
Old 13-June-05, 03:59 PM   #1 (permalink)
'Da Doctor of Funk
FunkyFresh's Avatar
Thumbs up Web Trick: Images Rollovers without Javascript

Heard about some neat code that'll let you do image rollovers without writing a line of Javascript (or VBScript, for that matter). Basically, it sets one image as a background and uses CSS's ":hover" property to show or hide an image in front of it. Works equally well in IE or Firefox.

See it in action

Here's the code:

index.htm
Code:
<html>
<head>
  <link rel="stylesheet" type="text/css" href="rollover.css">
</head>
<body>
  <a href="#top" id="funky" class="rollover"><img src="funky.gif"></a>
  <a href="#top" id="fresh" class="rollover"><img src="fresh.gif"></a>
</body>
</html>
rollover.css
Code:
.rollover { display: block; }
.rollover img { width: 100%; height: 100%; border: 0; }
.rollover:hover { visibility: visible; }
.rollover:hover img { visibility: hidden; }

#funky {
  background-image: url(funky_selected.gif);
  width: 100px;
  height: 50px;
}

#fresh {
  background-image: url(fresh_selected.gif);
  width: 100px;
  height: 50px;
}
For the sake of space, I stripped out the comments, though they're available in the example files I used. Thanks to redmelon.net for the idea & code!
FunkyFresh is offline     Reply With Quote
Old 13-June-05, 04:16 PM   #2 (permalink)
Apex Tech God
TYCOON's Avatar
Default

HOLY SHYT! This is over my head x3. But il give you a rep becuase it sounds like it will help others
TYCOON is offline     Reply With Quote
Old 13-June-05, 04:40 PM   #3 (permalink)
Apex's Squirrel Revolutionary
Fatsobob's Avatar
Default

Woot!
You da man Funky!
I think I will use this a little more often.
Thank you alot.
BLING BLING!
Fatsobob is offline     Reply With Quote
Old 13-June-05, 04:50 PM   #4 (permalink)
Foe
Apex Tech God
Foe's Avatar
Default

Very good find FF, and thanks for shring it.
Foe is offline     Reply With Quote
Old 13-June-05, 05:19 PM   #5 (permalink)
Apex Tech Demi-God
subdismal's Avatar
Default

Quote:
Originally Posted by FunkyFresh
Basically, it sets one image as a background and uses CSS's ":hover" property to show or hide an image in front of it.

Sneaky, sneaky. There's all sorts of little 'Web tricks', and that's definitely one of the slickest ones I've saw. Bling for sharing!
subdismal is offline     Reply With Quote
Old 09-August-05, 05:00 PM   #6 (permalink)
Apex Tech God
CubanConnectionZ's Avatar
Thumbs up

That is a neat lil web trick I must agree.
CubanConnectionZ is offline     Reply With Quote
Reply

Bookmarks

Thread Tools
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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slashdot // Mozilla Extending Javascript? Gizmo Slashdot RSS 0 29-May-05 03:14 AM
Javascript/HTML assistance on sound... Rob Coding / Scripting / Programming 1 10-October-04 10:45 PM
Any JavaScript pimps in here?? NapalmStixToKidz Coding / Scripting / Programming 10 03-August-04 06:15 PM
JavaScript and Fifrebird Spc. Forces Bob Other PC Problem / Help 0 05-January-04 04:18 PM
Plz help if you know JavaScript Lazy8s Anything Goes 8 24-January-03 06:56 PM


All times are GMT -5. The time now is 04:33 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright PCApex.com, GameApex.com, ForumApex.com 2001 - 2008
Advertisements

Page generated in 0.16364 seconds with 9 queries