Is there a way to change two or more Div styles with a single javascript line?
document.getElementById("searchScroll").style.position="fixed";
document.getElementById("searchScroll").style.margin="-50px";
Is it possible to merge the code in ONE line?
You can update it using a single line of JavaScript – but i would suggest leaving it as multiple – its easier to read and understand with multiple lines and you dont have to worry about replacing other style values.
You can go up a level and set the
style, for example :this will replace the current style .. to add you can use the following :
Example : http://jsfiddle.net/aDMke/