Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-27-2012, 03:39 PM   PM User | #1
SRD75
Regular Coder

 
Join Date: Sep 2011
Posts: 121
Thanks: 23
Thanked 0 Times in 0 Posts
SRD75 is an unknown quantity at this point
What file is controlling this swap image behaviour?

Hi. I've been asked to perform a website update to a website I did not build, and the front page has images that swap on mouse over.

This looks to be controlled by the CSS classes of the image and the hover image, but I can't see what file controls the behaviour; either CSS or JS.

The main image has a CSS class of "insert_image_name_here" and the hover image has a CSS class of "insert_image_name_herehover".

The reason I ask is because I need to add another image, and I need this image to swap on mouse over. If I duplicate the naming convention but give the new image a completely new base name for the CSS class, the swap behaviour does not occur.

I'm figuring there is a file I may need to add the base name to so that it is included in whatever controls the image swap, but I can't find this file.

Have you encountered a swap image behaviour based on CSS image class before? There may be a standard library the original designer used.
SRD75 is offline   Reply With Quote
Old 03-27-2012, 07:21 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello SRD75,
There is no file controlling that, no js anyway.
The CSS that's hiding the hovered image is here -
Code:
.module-fun a .f1hover, .module-food a .foodhover, .module_contact a .contacthover, .module_pic a .pichover {
    display: none;
}
Those images with the class .pichover are not displayed until the mouse is over the image, at which point this bit of CSS makes them appear -
Code:
.module-fun a:hover .f1hover,.module-food a:hover .foodhover,.module_contact a:hover .contacthover,.module_pic a:hover .pichover{display:inline}
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 03-28-2012, 03:36 AM   PM User | #3
SRD75
Regular Coder

 
Join Date: Sep 2011
Posts: 121
Thanks: 23
Thanked 0 Times in 0 Posts
SRD75 is an unknown quantity at this point
Hello Excavator

You've saved me from a world of hurt. I appreciate it. You've allowed me to complete my job.

Thanks again.

SRD75
SRD75 is offline   Reply With Quote
Reply

Bookmarks

Tags
css, hover, image swap, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 02:50 PM.


Advertisement
Log in to turn off these ads.