I have a <div>
with the CSS rule margin: 0 auto;
and I'm using MooTools to slide it when necessary.
It seems that the mere instantiation of an Fx.Slide
object removes the margin on my element. That is, whereas the element used to be centered inside its parent, it is now left-aligned. Just this line alone seems to do this:
var slide = new Fx.Slide('mydiv');
I can counteract this effect by doing something like this:
var slide = new Fx.Slide('mydiv');
$('mydiv').setStyle('margin', '0 auto');
But this is crude and I certainly don't want to have to do this every time I come across this situation. And even more so, I want to know, why does MooTools remove the margin in the first place? Is there an option I don't know about, some parameter I've neglected? Please let me know, as I'm new to MooTools. While I'm quickly finding that its applications are far and above those of jQuery (at least for my purposes), I'm finding that its documentation is much less verbose than its syntax.