[OpenLayers-Users] potential big IE performance enhancement-
help!
mortac8
ashley_c_mort at raytheon.com
Tue May 18 13:21:41 EDT 2010
That actually seems a bit slower :(
2:59- to render my layer setting node.style.display="none"; then
node.style.display="";
2:42- the original way
I don't understand why setting node.style.cssText is different than
node.style. Can you explain it briefly? I ask because the simple example
below seems to work as I'd expect VML.js:setStyle to work.
Thanks again!
Ashley
<html>
<body>
<div
style="left:50px;top:50px;width:800px;height:600px;background-color:gray;">
</div>
<div id="target"
style="position:absolute;width:5px;height:5px;left:100px;top:75px;background-color:red;"></div>
<script type="text/javascript">
var t = document.getElementById("target");
var top = 300;
var left = 400;
setInterval(move, 750);
function move() {
top=Math.floor(Math.random()*600);
left=Math.floor(Math.random()*800);
t.style.cssText="position:absolute;width:5px;height:5px;background-color:red;top:"
+ top + "px;left:" + left + "px;";
}
</script>
</body>
</html>
Andreas Hocevar-2 wrote:
>
> Hi,
>
> setting cssText is not the same as setting the style. But you could
> instead try to call
>
> node.style.display = "none";
>
> as first line of the setStyle method, and
>
> node.style.display = "";
>
> as last line of the setStyle method.
>
> Let us know if this also boosts performance.
>
> Good luck,
> Andreas.
>
>
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/potential-big-IE-performance-enhancement-help-tp5070709p5071123.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list