See if the browser is smart.
Change the span to a div (span''s are inline, and thus are not allowed
dimensions... and divs are block elements)
Set a width and height on the div.
See if the screen is redrawn then, with the fixed width and height,
optimally the browser would realise there''s no need.. but no promises,
it''s
just a suggestion.
Gareth
On 9/7/07, Surendra
<singhi.surendra-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> Hi,
> For a textfield with a limit, I have a counter which shows the
> number of remaining characters in a span.
>
> Initially, for each keyup event, I was updating the count using
> nodeValue function. But, as the page became large, the update of the
> text by the browser has become very slow.
>
> It seems for every text change, the browser calculates the redisplay
> position of other elements on the page, even though its not needed.
>
> What trick can I use to speed up the text update?
>
> Thanks!
> --
> Surendra Singhi
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---