Open jaunkst opened 10 years ago
an example.
.fixed_element{style: "position:fixed; bottom:0px;}
$('parent_element').transition({ y: '40px' });
This would break the .fixed_element fixed position because the transform on its parent.
While no duplicate of #18 (stop a transition), this might still be kind of related.
You may remove a transition by setting an empty transform like so:
var $element = $('parent_element');
$element.css('-webkit-transform', '');
$element.css('-ms-transform', '');
[...] // add vendor prefixes as necessary
$element.css('transform', '');
:+1: I'm also in need of this, also in combination with a fixed element :)
How about something like this...adds detection for browser prefixes.
var target = $('some_element');
target.transition({ blah: 'blah'},'','',transReset); //calls transReset after complete
function transReset(target){
var transPrefix = ($.browser.webkit) ? '-webkit-transform' :
($.browser.mozilla) ? '-moz-transform' :
($.browser.msie) ? '-ms-transform' :
($.browser.opera) ? '-o-transform' : 'transform';
target.css(transPrefix,'');
}
Just a note, $.browser is no longer used in jQuery 1.9+
yup, there are a few others out there that would work...prefixfree.js, modernizr, https://github.com/codler/jQuery-Css3-Finalize or maybe even http://www.verious.com/qa/dynamic-css3-prefix-user-agent-detection/
+1 on this. It would be great to have some method to clean up after .transition()
and .css()
By the way, these lines:
https://github.com/rstacruz/jquery.transit/blob/master/jquery.transit.js#L63:
support.transition = getVendorPropertyName('transition');
https://github.com/rstacruz/jquery.transit/blob/master/jquery.transit.js#L81-L88
// Populate jQuery's `$.support` with the vendor prefixes we know.
// As per [jQuery's cssHooks documentation](http://api.jquery.com/jQuery.cssHooks/),
// we set $.support.transition to a string of the actual property name used.
for (var key in support) {
if (support.hasOwnProperty(key) && typeof $.support[key] === 'undefined') {
$.support[key] = support[key];
}
}
+1 on this. Right now I use something like:
$panel.css('transition', 'none')
This is what I use for now too but isn't perfect at all
Should remove all webkit transitions from the style. Example, Transitions can break css fixed styles and one may want to remove the transitions so their is no conflict.