Question

how can I add some code so that my translate3d effect also works on firefox. The jquery code is:


if (st > lastScrollTop){

$('div#search-apartments #content-inner #search-box').attr('style', '-webkit-transform:translate3d(0, '+movepx+'px, 0)');

} else {

$('div#search-apartments #content-inner #search-box').attr('style', '-webkit-transform:translate3d(0, '+movepx+'px, 0)');

So how and where do I need to add the code for "-**moz**-transform:translate3d(0, '+movepx+'px, 0)"??

Thanks!

Was it helpful?

Solution

use this code this will help you to solve for firefox also

$('div#search-apartments #content-inner #search-box').attr('style', '-webkit-transform:translate3d(0, '+movepx+'px, 0);-moz-transform:translate3d(0, '+movepx+'px, 0)');

OTHER TIPS

USE THIS

if (st > lastScrollTop){

    $('div#search-apartments #content-inner #search-box').css({'-webkit-transform':'translate3d(0, '+movepx+'px, 0)','-moz-transform:translate3d(0, '+movepx+'px, 0)'});
} else {

    $('div#search-apartments #content-inner #search-box').css({'-webkit-transform':'translate3d(0, '+movepx+'px, 0)','-moz-transform:translate3d(0, '+movepx+'px, 0)'});
}

Thank you guys.

Alex, yours didn't work somehow but Sohail, yours works perfectly. I just extended your solution for IE and Opera and made this out of it:

$('div#search-apartments #content-inner #search-box').attr('style', '-webkit-transform:translate3d(0, '+movepx+'px, 0);-moz-transform:translate3d(0, '+movepx+'px, 0);-ms-transform:translate3d(0, '+movepx+'px, 0);-o-transform:translate3d(0, '+movepx+'px, 0)');

Again, thank you

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top