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.

CSS Forum


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



Reply
How to have the parent page background color during dropdown?
Old 10-14-2011, 02:05 PM How to have the parent page background color during dropdown?
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
Hi there,

I have this site here with a dropdown, I'm having trouble in making the dropdown menu parent page stay the same background color as when you scroll down to different pages...

http://www.manausfund.org.php5-21.we...p?page=funding


Lil help? Anything would be greatly appreciated.

Thanks
Reckoner is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-15-2011, 12:11 AM Re: How to have the parent page background color during dropdown?
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
ugh losing my mind on this.... lil help?


Also, if some kind soul out there could possibly take a look and help out with the jumpy dropdown menus that would also be awesome.
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 10-15-2011, 02:14 AM Re: How to have the parent page background color during dropdown?
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 9,007
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
I'm not seeing either of these problems you're describing in FF or IE. In what browser is the problem occurring?

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 10-15-2011, 04:30 AM Re: How to have the parent page background color during dropdown?
Average Talker

Posts: 17
Trades: 0
I am seeing it in FF4: http://prntscr.com/3hz0v. The same (color) appears in IE8. But I don't see any background: or background-color: declaration in your menu CSS?
__________________
Frank

Please report back how suggestions worked out.

Last edited by FrankknarF; 10-15-2011 at 08:34 AM.. Reason: Grammatical typo
FrankknarF is offline
Reply With Quote
View Public Profile
 
Old 10-15-2011, 05:09 AM Re: How to have the parent page background color during dropdown?
vultren's Avatar
Webmaster Talker

Posts: 583
Name: Tony
Location: Seattle Washington
Trades: 1
Quote:
Originally Posted by Reckoner View Post
help out with the jumpy dropdown menus that would also be awesome.
Your hover class extends longer than your a class. Hens the reason for the jumping.
__________________

Please login or register to view this content. Registration is FREE

I am here to give advice as well as learn.

Please login or register to view this content. Registration is FREE
.
vultren is online now
Reply With Quote
View Public Profile
 
Old 10-15-2011, 11:42 AM Re: How to have the parent page background color during dropdown?
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
Thanks for the replies guys...

I should be more specific, I need to have it so that the main nav stays the background color when you scroll over other pages.

When you scroll over "our partners" to "lift up" you will then see that "our partners" does not stay the background color and it goes away.

Also, any two line item like "western colorado preschool cooperative" bg color extends past the menu. Tried fixing that last night to get rid of the bumpyness but now can't figure out how to make stuff with display: block without breaking incorrectly.

losing my mind over this haha
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 10-15-2011, 11:57 AM Re: How to have the parent page background color during dropdown?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You will have to use javascript to make the parent element maintain the hover state when you "mouseover" the child elements.

off the top of my head
Code:
onmousover=this.parentNode.style.backgroundColor =  this.style.backgroundColor;
on the child elements should work.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-15-2011, 02:17 PM Re: How to have the parent page background color during dropdown?
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
hmm okay... do you happen to have an example of the code used to do something like that so that I can pretty much copy / implement?
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 10-15-2011, 02:52 PM Re: How to have the parent page background color during dropdown?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Convert it into a function

Code:
function setParent(object) {
      e = getElementByid(object.id);
      e.parentNode.style.backgroundColor =  e.style.backgroundColor;
}
Code:
 onmousover="setParent(this);"
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-15-2011, 04:09 PM Re: How to have the parent page background color during dropdown?
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
thanks for the reply chris. hmm sorry I don't follow... do you recommend that I apply the

onmousover=this.parentNode.style.backgroundColor = this.style.backgroundColor;

as a javascript function, and then apply the onmousover="setParent(this);" to the parent ul li's?

Last edited by Reckoner; 10-15-2011 at 04:12 PM..
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 10-15-2011, 06:33 PM Re: How to have the parent page background color during dropdown?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the onmouseover event is for the child elements
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-15-2011, 11:19 PM Re: How to have the parent page background color during dropdown?
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
Right, but I just don't get where I implement this Function.. would it be a javascript function?

If so, then on each child element I include the onmouseout event?

Sorry this is quite frankly the most frustrating css menu issue I have ever encountered.... seems like it should be so simple.

Last edited by Reckoner; 10-15-2011 at 11:32 PM..
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 10-16-2011, 01:03 AM Re: How to have the parent page background color during dropdown?
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 9,007
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
First, you would create an external javascript file that's called for in the head of each page.

Using getelementbyid you identify the child elements by the id they should already have.

By using what Chris posted the parent's color stays the same when the child is hovered over as when the parent is hovered over. That's why you have to do it by the id of the child, since the behavior needed of the parent isn't required when directly interacting with it.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 10-16-2011, 03:46 AM Re: How to have the parent page background color during dropdown?
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Maybe I missed something in the discussions in this thread, but I don't see why this issue would require javascript to be solved

As on example, check out this menu
http://www.htmldog.com/articles/suck...downs/example/

It works fine without javascript.
And for those who are picky: yes, there is a small javascript there as well, but as far as I can tell it's only to make the menu compatible with old browsers (IE) that can't handle :hover for other than <a> tags. At least it works fine for me evan with javascript disabled.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.

Last edited by lizciz; 10-16-2011 at 04:11 AM..
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 10-16-2011, 05:51 AM Re: How to have the parent page background color during dropdown?
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
Thanks for the reply lizciz... that actually got me on the right track. Getting sooo close now.

Added a #primary-nav li:hover {
background-color: #45585c;
color: #ffffff;
}
with a background-color which seemed to have added the background now when you mouse over the other elements in the dropdown.

Now the only thing is though... that the color of the text needs to be white when you mouse over it as well. Ugh. Any tips?

http://www.manausfund.org.php5-21.websitetestlink.com/


****. Also just realized that the :hover isn't working in Chrome to get the white text to show up... just cannot win with this menu

Last edited by Reckoner; 10-16-2011 at 06:37 AM..
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 10-16-2011, 06:56 AM Re: How to have the parent page background color during dropdown?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
At a cursory look over, it would appear the the HTMLDog javascript is doing the same thing as I proposed, only their's is a much tidier solution and using the DOM and classNames rather than "fudging it" with getElementByID
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-16-2011, 09:33 AM Re: How to have the parent page background color during dropdown?
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
I don't want this thread to meander off-topic, but CSS L4 will allow this stuff to be created very easily: http://dev.w3.org/csswg/selectors4/#subject
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 10-16-2011, 09:40 AM Re: How to have the parent page background color during dropdown?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by Physicsguy View Post
I don't want this thread to meander off-topic, but CSS L4 will allow this stuff to be created very easily: http://dev.w3.org/csswg/selectors4/#subject
So another fifteen - twenty years or so ....
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-16-2011, 10:30 AM Re: How to have the parent page background color during dropdown?
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 10-16-2011, 12:22 PM Re: How to have the parent page background color during dropdown?
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
Yeah that will be cool, but until then does anyone know what i can do?
Reckoner is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to have the parent page background color during dropdown?

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