2

And I have a div with class="sc-bar" which act as a scroll bar of the "container". Now I want to transform "sc-bar" through JQuery CSS property,

$('.sc-bar').css('transform','scaleY(0.5)');

But not working, I also tried with all prefixes like webkit, moz.

1
  • 1
    Your code seems to work fine: jsfiddle.net/n7s1hvkv. Have you included jQuery.js properly, and run your code in a document.ready handler? Also make sure you're testing in a browser which supports CSS transforms Commented May 17, 2017 at 10:34

1 Answer 1

3

I've actually tested below and seems to be working?

$('.sc-bar').css('transform','scaleY(0.5)');

Is the line enclose on $(document).ready() or made sure that jQuery is loaded before using this like below?

// A $( document ).ready() block.
$(document).ready(function() {
    // your code here...
    $('.sc-bar').css('transform','scaleY(0.5)');
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.