Thanks!
I had fixed my code and your answer inspired me to map the elements
with the class into an array.
My script become more responsive now.
On Jul 8, 8:31 pm, "Joel Birch" <[EMAIL PROTECTED]> wrote:
> Hi Evert,
>
> '.someclass' is a slow selector as it has to check every single
> element on
Be sure to change that [ to a ( so it will work. :)
On Jul 8, 8:31 am, "Joel Birch" <[EMAIL PROTECTED]> wrote:
> Hi Evert,
>
> '.someclass' is a slow selector as it has to check every single
> element on the page to see if it matches class="someclass". Limiting
> the search closer to the desired
Hi Evert,
'.someclass' is a slow selector as it has to check every single
element on the page to see if it matches class="someclass". Limiting
the search closer to the desired elements will speed up the selection
hugely. For example, choose the closest common ancestor that all
potential target el
The code is simple...
.simpleclass{
opacity: 0.5;
background: green;
}
...
$(function()
{
$(".simpleclass").removeClass("simpleclass");
}
);
P/S: I had made a mistake in my previous post. It is not an id. It is
a class.
On Jul 3, 12:37 am, spicyj <[EMAIL PROTECTED]> wrote:
> Can you
Why are you using an ID on 2 different elements?
On Jul 2, 11:51 am, Evert <[EMAIL PROTECTED]> wrote:
> //only 2 elements to remove
> $("#id").removeClass('onesimpleclassonly');
>
> It took almost 3 ~ 4 seconds to remove the class.
> What can I do to speed up the process?
Can you give a sample page? I'm confused about what you mean by "only
2 elements to remove".
On Jul 2, 9:51 am, Evert <[EMAIL PROTECTED]> wrote:
> //only 2 elements to remove
> $("#id").removeClass('onesimpleclassonly');
>
> It took almost 3 ~ 4 seconds to remove the class.
> What can I do to spe
6 matches
Mail list logo