CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 2nd, 2004, 03:27 PM
atlas2785's Avatar
atlas2785 atlas2785 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Earth
Posts: 4 atlas2785 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
CSS onMouseover using both image and text

hello,

I did search the forum for this but it may be unique, I am using css onmouseover effect to change the background image of my menu from one image to the other to ceate the lighted effect. I am also using text display over these images. The text also "lights-up" with the hover effect. the problem i have though is I would like the text part to "light-up" with the image when the cursor is over the image.... not like it is now with the image lighting up before the text.

see URL for details.

I realize I could just use an image entirly, but since my menu is generated by php, this is not an option.

Edit I did find one source for getByID, but i cannot seem to make it work.... help is appreciated.

Thanks in advance,

Last edited by atlas2785 : February 2nd, 2004 at 04:35 PM.

Reply With Quote
  #2  
Old February 2nd, 2004, 10:20 PM
vbrtrmn's Avatar
vbrtrmn vbrtrmn is offline
4:04 Time Not Found
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2004
Location: Northern Virginia
Posts: 2,022 vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 20 m 26 sec
Reputation Power: 232
Send a message via ICQ to vbrtrmn Send a message via AIM to vbrtrmn Send a message via MSN to vbrtrmn Send a message via Yahoo to vbrtrmn
you should change the style of the text, along with the background image. you should also preload your images.

Reply With Quote
  #3  
Old February 3rd, 2004, 12:04 AM
atlas2785's Avatar
atlas2785 atlas2785 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Earth
Posts: 4 atlas2785 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
exaclty what he said, but i need it to work in this php code
Code:
function theme_draw_menu_item( $text, $link )
{
        return "<tr class=\"none\" height=\"24\"><td align=\"center\" valign=\"middle\" background=\"images/menuout.gif\" onmouseover=\"this.background='images/menuin.gif';style.cursor='hand';\"  onMouseOut=\"this.background='images/menuout.gif'\" onClick=\"location.href='$link'\"><a id=\"menutext\" class=\"menutext\" href=\"$link\">$text</a></td></tr>\n";

}

Last edited by atlas2785 : February 3rd, 2004 at 12:08 AM.

Reply With Quote
  #4  
Old February 3rd, 2004, 01:00 AM
vbrtrmn's Avatar
vbrtrmn vbrtrmn is offline
4:04 Time Not Found
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2004
Location: Northern Virginia
Posts: 2,022 vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level)vbrtrmn User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 20 m 26 sec
Reputation Power: 232
Send a message via ICQ to vbrtrmn Send a message via AIM to vbrtrmn Send a message via MSN to vbrtrmn Send a message via Yahoo to vbrtrmn
You could generate the javascript with PHP as well... instead of trying to stuff it all into the onmouseover, do it as a dynamically generated function.

Reply With Quote
  #5  
Old February 3rd, 2004, 08:29 AM
atlas2785's Avatar
atlas2785 atlas2785 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Earth
Posts: 4 atlas2785 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm having trouble understanding. Do you think you can post an example.

Thanks

Reply With Quote
  #6  
Old February 4th, 2004, 12:20 PM
atlas2785's Avatar
atlas2785 atlas2785 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Earth
Posts: 4 atlas2785 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok, I've started trying to pre-load images and do the swapping image thing, but I just cannot seem to make it work this way now. I need a little bit of help with it please. Also I would like for the text to change its color too when the cursor is over the image. Not sure how to do this either. Below is the javascript code I am using.

<SCRIPT LANGUAGE="JavaScript">
<!-- hide from none JavaScript Browsers

Image1 = new Image(140,24)
Image1.src = "images/menuin.gif"

Image2 = new Image(140,24)
Image2.src = "images/menuout.gif"

function SwapOut() {
document.imageflip.src = Image2.src; return true;
}

function SwapBack() {
document.imageflip.src = Image1.src; return true;
}

// End -->
</SCRIPT>

And here is a sample of the table that I'm trying to affect.

<?php
}

function theme_draw_menu_item( $text, $link )
{
return "<tr name=\"imageflip\" class=\"none\" height=\"24\"><td align=\"center\" valign=\"middle\" background=\"images/menuout.gif\" onmouseover=\"SwapOut()\" onMouseOut=\"SwapBack()\" onClick=\"location.href='$link'\"><a id=\"menutext\" class=\"menutext\" href=\"$link\">$text</a></td></tr>\n";
}
?>

I am using PHP code to dynamically create a menu, so it is important that the text links "over" the buttons remain text.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS onMouseover using both image and text


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT