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.

HTML Forum


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



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Change entre CSS Selector from JavaScript, not just one ID
Old 11-14-2004, 10:52 AM Change entre CSS Selector from JavaScript, not just one ID
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
Hi,

Does anyone know how to change an entire CSS Selector using JavaScript?

I have the following CSS in /styles/navigate.css:

Code:
 
#ulNavigate li {
 background-image: url(../images/nav_li_bg.png);
 background-repeat: no-repeat;
 margin-top: 3px;
 padding: 0px;
 list-style: none;
 width: 132px;
 height: 26px;
}
As you can see, the background image is a PNG. This is because it has a drop shadow and is going to be placed over a gradient.

I have a bt of Browser Detection, and what I want to do, is take away the background-image element and replace it with a DirectX Filter. I can do ths if I know the ID of each of the LI elements, but I don't - they're generated dynamiclly and I don't give them an ID.

Any ideas?
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
 
Register now for full access!
Old 11-14-2004, 11:40 AM
zcorpan's Avatar
Average Talker

Posts: 15
Trades: 0
I guess you want to use different code for IE, right?

http://www.webmaster-talk.com/showthread.php?t=18295
__________________

Please login or register to view this content. Registration is FREE
zcorpan is offline
Reply With Quote
View Public Profile
 
Old 11-14-2004, 12:35 PM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
The Star CSS Bug worked to put the filter in for IE, however it overlays it with the origional background image. How do I use CSS to turn it off? (One way is setting the background-position to push it out, but if there's something more relavant I'd rather use it, I'm a bit of a perfectionist)

Also, minor problem, the CSS won't validate now there's a filter: attribute in there, which is why I wanted to use JavaScript.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 11-14-2004, 01:16 PM
zcorpan's Avatar
Average Talker

Posts: 15
Trades: 0
you could use
Code:
background: transparent;
Edit:
Quote:
Also, minor problem, the CSS won't validate now there's a filter: attribute in there, which is why I wanted to use JavaScript.
In my opinion, invalid CSS is better than using JavaScript for the same purpose. Since it's under "* html" (which actually also is invalid, since html is the root element) it will be ignored by all css compliant browsers except for IE (well, IE isn't really css compliant...).

If you want to use valid code then you will also have to ignore IE...
__________________

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

Last edited by zcorpan; 11-14-2004 at 01:35 PM..
zcorpan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Change entre CSS Selector from JavaScript, not just one ID
 

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