c# - jQuery animate is very slow in both IE and Firefox -
i using jquery animate() function show small text becoming larger , larger, until disappear.
i have jquery code here:
function gain() { /* using multiple unit types within 1 animation. */ $("#block").animate({ width: "80%", opacity: 0.0, marginleft: "2.6in", fontsize: "15em", borderwidth: "10px" }, 2000, function () { $("#block").removeattr("style"); $("#block").html(""); $("#block").css("color", "white"); $("#block").css("position", "absolute"); $("#block").css("z-index", "-5"); });
}
the code use fire function:
string script = "$('#block').html('yes!<br/>" + xpreward.tostring() + "xp!');"; scriptmanager.registerstartupscript(buttonlistupdate, typeof(string), "startup", "xpgain(); " + script, true);
this code run everytime select option in radiobuttonlist (asp.net).
now, have issue:
- chrome - works
- safari - works
- iphone browser - works ok
- internet explorer - horrible
- firefox - great, other times horrible
i ignore internet explorer, have large market share, have deal issue.
you can try animation yourself
- go http://www.gamelearner.com
- click large "play now" button
- click "play right away"
- answer question correctly. first question might take ~5-10s
so question is....
how make work in internet explorer? right horrible. don't expect work good, "playable" awesome...
thanks lot! lars
just thought - you're using %
, em
, px
, in
units of measurement. perhaps if standardised on 1 measurement unit, things might work faster. don't know though, having guess.
also in function runs when animation's complete, chain actions on $('#block') element, e.g.
$("#block").removeattr("style").html("").css("color", "white").css("position", "absolute").css("z-index", "-5");
Comments
Post a Comment