Currently I am attempting to replicate the "slideUp" and "slideDown" features in jQuery while utilizing a flexbox for display!
jQuery.fn.toggleFlexbox = function() {
var elm = $(this[0]);
if(elm.css('display') === "none"){
elm.css('display', '-webkit-flex');
}else{
elm.slideUp('fast');
}
};
I have made some progress with this (the code above currently functions but does not slide when toggling from "none" to "-webkit-flex"). I attempted the following:
elm.animate({"display":"-webkit-flex"}, 1000);
Unfortunately, this approach did not work at all - no animation or error message.
The reason behind this effort is that I want all elements with the class "Settings" to load initially as display flex, then hide them using:
$('.settings').hide();
However, it seems that applying flexbox is not successful when I try to slide down the Settings section. Oddly enough, if I navigate to another page and return, everything works as intended... very strange!
Interestingly, I am unable to reproduce this issue in Fiddler.... http://jsfiddle.net/FzqA7/ ..