2

i am trying how to use jquery to dynamically change -webkit.

my css

::-webkit-scrollbar-button {
    height: 75px;
    width: 0;
    -webkit-box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
}

my jquery

        $('::-webkit-scrollbar-button').css("height",'100px');

1 Answer 1

1

I would just dynamically add a script element.

$('body').append('<style>::-webkit-scrollbar-button{height:75px;}</style>');

If you have to change this frequently you can remove the last one before you add the next one, but it wouldn't exactly be necessary because the last one would take precedence.

var $style = $('<style id="dynamicStyle">::-webkit-scrollbar-button{height:75px;}</style>');
$('#dynamicStyle').remove();
$('body').append($style);
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.