Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8656269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:14:12+00:00 2026-06-12T15:14:12+00:00

I have a variable called value in my js that gets updated based on

  • 0

I have a variable called value in my js that gets updated based on the scrollbars percent. my value is between 0 – 360. I want a way to update the below css values. Is there a way I can group them together in an object and pass the value to them. For example when using opacity I can do something like this.

function updateCSS(target, value){
 var cssObj = {};
 cssObj["opacity"] = value;
 target.css(cssObj);
}

I need a way to be able to update all the prefix rotate property with my value number. Any good ideas how I could do this.

-webkit-transform: rotate(value);  /* Safari 3.1+, Chrome 
     -moz-transform: rotate(value);  /* Firefox 3.5-15 
      -ms-transform: rotate(value);  /* IE9+ 
       -o-transform: rotate(value);  /* Opera 10.5-12.00 
          transform: rotate(value);  /* Firefox 16+, Opera 12.50+ 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:14:13+00:00Added an answer on June 12, 2026 at 3:14 pm

    Just use the .css() method, and also you forgot to include deg:

    function updateCSS(target, value){
        target.css({
            '-webkit-transform': 'rotate('+value+'deg)',
            '-moz-transform': 'rotate('+value+'deg)',
            '-ms-transform': 'rotate('+value+'deg)',
            '-o-transform': 'rotate('+value+'deg)',
            'transform': 'rotate('+value+'deg)'
        });
    }
    

    Fiddle:
    http://jsfiddle.net/XKyEz/3/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a variable that very rarely gets an incorrect value. Since the system
I have created a page called profile.php that gets a value from mainpage.php, by
I have a variable called var in SAS/IML. I want to know how I
I have a variable called $value in php which has a string value. When
I have an expensive function call that gets called once per loop, but I
I have a variable called posts_object[i].updated_time It's always an utf-timecode. It seems to always
I have a variable called $effectiveDate containing the date 2012-03-26 . I am trying
Okay so i have a variable called search which holds the string Find this
Say you have a variable called hotelPropertyNumber . The contents will always be a
Maybe you guys can help: I have a variable called $bio with bio data.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.