Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / April 2008



Tip: Looking for answers? Try searching our database.

IE sucks (or maybe it's me): class selector fails

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DuncanIdaho - 23 Apr 2008 14:12 GMT
Hello

IE 7.0.5730.11
Opera 9.27
Firefox 2.0.0.14

I have the following in my stylesheet

.navbody a{
    text-decoration: none;
    color: rgb(68, 146, 181);
}

a.leaf{
    text-decoration: none;
    color: rgb(254, 100, 253);
    font-size: 0.75em;
}

AJAX produces the following html

<div id="navmenu">
<div id="menuheader">
 Browse Catagories
 <br/>
<a href="javascript:getMenuUpdate('-1')">collapse menu</a>
</div>
<div id="menudiv" class="navbody">
<span>
<a href="javascript:getMenuUpdate('1')">
</a>
<a class="node" href="javascript:getMenuUpdate('1')">Jewellery</a>
</span>
<br/>
<span>
<img border="0" src="images/navspacer.jpg"/>
<a class="leaf" href="products?catagoryId=1:1">Earrings</a>
</span>
... etc

in Opera and Firefox the anchor with class 'leaf' is rendered in a
smaller pink font (nice!) in IE it's rendered in the same sized light
blue as other stuff in the navbody

Are class selectors supposed to work when output is dynamically
generated ? or is this another 'feature' of IE

TIA

Idaho
Steve Pugh - 24 Apr 2008 12:55 GMT
On Apr 23, 2:12 pm, DuncanIdaho <Duncan.Idaho2...@googlemail.com>
wrote:

> I have the following in my stylesheet
>
[quoted text clipped - 10 lines]
>
> AJAX produces the following html
[snip]

> in Opera and Firefox the anchor with class 'leaf' is rendered in a
> smaller pink font (nice!) in IE it's rendered in the same sized light
> blue as other stuff in the navbody
>
> Are class selectors supposed to work when output is dynamically
> generated ? or is this another 'feature' of IE

Known problem with IE when elements are added to the DOM via scripting
(the fact that the content was fetched via AJAX is irrelevant, you can
see the same issue when adding it locally). You need to apply the
class via the className property _after_ the element has been inserted
into the DOM. I used to know the reason for this but it's slipped my
mind (must be getting old). Ask in an IE or JavaScript related group
for more details.

   Steve
DuncanIdaho - 27 Apr 2008 09:18 GMT
> On Apr 23, 2:12 pm, DuncanIdaho <Duncan.Idaho2...@googlemail.com>
> wrote:
[quoted text clipped - 23 lines]
>
> Known problem with IE when elements are added to the DOM via scripting

OK, well I tried a javascript group with no luck, I've got a few ideas
though so I'll give them a try.

Thanks for taking the time to reply

Idaho
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.