I'm trying to do that due to this issue:
http://groups.google.com/group/jquery-en/browse_thread/thread/0a3630dc90b2c10b/1026fc07b5cd587f?#1026fc07b5cd587f

If you have any other and better solution, I'm all hears :)

You say the DOM element does not exist, but isn't that what clone is
supposed to do? I though I was cloning an element in the DOM and then
changing it's class...

On Aug 7, 3:45 pm, "Dan G. Switzer, II" <[EMAIL PROTECTED]>
wrote:
> >I'm having 2 little issues regarding IE6/7 with 2 instructions that
> >seem to work just fine in most browsers but not in IE6/7.
>
> >First one, using clone() method:
> >$('div#content a').each(function(elem) {
> >    if(elem === 0) {
> >            var color = $(this).clone(false).addClass('content-
> >link').css('color');
> >    }
> >}
>
> In IE6/7, some things just don't work correctly if an element isn't in the
> DOM. Most of these issues are based upon visual aspects of the element.
> Also, the cloneNode method in IE 6/7 also has some issues 
> (seehttp://192.168.1.70/working/jquery/cloneNode_issue.htm)--whichis what
> clone() uses.
>
> What I suspect to be the problem is that since the $(this).clone(false)
> object doesn't actually exist in the DOM, it can't actually read the color
> property from the class declaration.
>
> My guess is if you added that element to the DOM, the color would report
> correctly.
>
> Why are you trying to read the color in that way anyway?
>
> -Dan

Reply via email to