When my script processes a block of style changes for a large number of
paragraphs, the screen updates after each individual style change, which can
look messy.
I have tried screen.updateInterval, but this only affects or delays the
initial activation of the JavaScript.
Once the JavaScript is processing,
the screen is still updated instantly after each instruction is processed.
Is there anything I can do to stop the screen updating until a block of Java
Script has processed?
Jules
<STYLE ID="style1">
P {
color: lime;
}
</STYLE>
<STYLE ID="style2">
P {
color: blue;
}
</STYLE>
<SCRIPT>
</SCRIPT>
</HEAD>
<BODY ONCLICK="document.getElementById('style2').disabled =
!document.getElementById('style2').disabled">
<P>
Kibology for all.
</P>
<P>
All for Kibology.
</P>
I don't know if that fits your needs but could imagine that such
stylesheet toggling is faster and smoother than changing individual
styles.
--
Martin Honnen
Does window.offscreenBuffering=true have any effect?
What code are you using to do the changes, there could be a different
approach.
Jim.
It may not quite fit my need, which is to selectively display individual
paragraphs within a document, akin to a the msdn cascading table of
contents.
See the vary basic web site if have started at www.baconbutty.com if you are
interested.
Regards Julian
I have tried it, but unfortunately it does not work.
If you are interested, have a look at what I am trying at
www.baconbutty.com - the welcome page.
Its nothing special, but if you have any other ideas.
Regards
Julian
Just an update to my last message.
Thankyou Martin Honnen. I have experimented with the "disabled" property
and met with success.
I have included two links in the web page as follows:-
<link id=sheet1 rel=stylesheet type=text/css src=stylesheet1.css>
<link id=sheet2 disabled=true rel=stylesheet type=text/css
src=stylesheet2.css>
Both style sheets set up identical classes, except that in all classes in
sheet 2, display is set to none.
The key move then is in sheet1 to set up two classes for each element: For
example
.elementvisible {display:block}
.elementinvisible {display:none}
Importantly, in sheet2, elementvisible is also {display:none}
When I want to display only certain of the elements in the page I then do as
follows:-
1. Set disabled=false for sheet2 <link>, so everything disappears.
The browser gives priority to the second stylesheet. So the order of the
stylesheets is important.
2. Process the elements in the document, so that those which I want
to see are className="elementvisible", and those I want to hide are
className="elementInvisible"
3. Set disabled=true for sheet2, so that sheet1 is re=applied.
Thanks
Jules