javascript - Slow down setAttribute() -


is possible slow down setattribute()? example, have following code:

function hide(i) {     var previewdiv = document.getelementbyid('preview');     var fulldiv = document.getelementbyid('full');     previewdiv.setattribute('style', 'display:normal;');     fulldiv.setattribute('style', 'display:none;'); } 

now want make display:none go display:normal delay "fades" open instead of bluntly open. or there way achieve this?

it can done in multitude of ways. use jquery's fadein method $('.element').fadein(); or using css , javascript. found example http://www.chrisbuttery.com/articles/fade-in-fade-out-with-javascript/ chris buttery.

i comes down taste. although 1 argue second option should more optimal on systems.


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -