Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS -webkit-transform: translate() on Android Browser

I can't seem to get the translate property or -webkit-transform working on Android browser correctly, despite success in iOS and every desktop browser.

My 'full' solution is a small jQuery function like this:

$.fn.transition = function (properties, options) {
    var $element = $(this);
    options = $.extend({}, cssDefaults, options);
    properties['webkitTransition'] = 'all ' + options.duration + 'ms ' + options.easing;
    $element.css(properties);
    return this;
};

which is called like this:

$element.css("transform","translate(1000px,0px)");

I've read in some places that Android has broken support for multiple css3 actions at the same time; however even when I replace all of this code with this simple dummy call the transform never happens:

$element.css("-webkit-transform","translate(1000px,0px)");

Am I doing something wrong that is specific to android?

like image 485
Msencenb Avatar asked Aug 08 '26 08:08

Msencenb


1 Answers

I have just ran into this with

-webkit-transform: translate3d(0,200px,0);

So I am hoping this will help you. I believe this is one of the 'broken' css3 elements in the Android Browser.

I had to sub out the above code with top: 200px;

In your situation, I would try using a simple left such as left: 1000px;

remember your position statement if you need more accurate control

like image 107
seth yount Avatar answered Aug 09 '26 21:08

seth yount



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!