Tuesday, December 22, 2015

Smooth expansion of DIV with jQuery

var bigWidth=800;
$("#map").width() == bigWidth ?
 $("#map").fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300).animate({ height: 400, width: 400 }) :
 $("#map").fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300).animate({ height: 400, width: 800 });

No comments: