user2718671
user2718671

Reputation: 2976

How to manipulate transform: translate3d values with jQuery?

I'm using the bxslider and I needed to modify it because there was no built in function for my purposes. But now I need to change the transform: translate3d values of the slider so that it will be displayed correctly. But how?

With using this syntax following error will occur:

$('#custom_pager_list').css({
    transform: translate3d(-400px, 0, 0)
})

SyntaxError: identifier starts immediately after numeric literal

Using the same syntax without "px" leads to this:

ReferenceError: translate3d is not defined

Upvotes: 2

Views: 10147

Answers (1)

Pierre
Pierre

Reputation: 19071

You need to add quotes around the transform value:

$('#custom_pager_list').css({
    transform: "translate3d(-400px, 0, 0)"
})

Upvotes: 6

Related Questions