#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    675
    Rep Power
    38

    JQuery animate image and backgroundColor


    OK, I'm using jQuery. I have the image animating but not the backgroundColor.

    Here's the test site: click here

    Click on the first circle to see the animation.
    The background color should change as well.
    Here is my jQuery code:
    Code:
    <script type="text/javascript">
    $("document").ready(function(){
    $('#circle1').click(function() {
    $('#circle1').animate({
    height: '1200px',
    width: '1200px',
    marginTop:'-500px',
    marginLeft:'-500px'
    });
    $('#body_holder').animate({
    backgroundColor: '#dad24e'
    });
    });
    });
    
    </script>

    Also, if you can help with this, I need to time the animations. I'll have to work on the timing, but basic time code would be super helpful.

    Please let me know if you have any questions or ides.

    thanks
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,131
    Rep Power
    4304
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    675
    Rep Power
    38

    thanks Kravvitz


    I'll give it a shot and let you know how it goes.

    thanks again
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    675
    Rep Power
    38

    jQueryColor and animation


    OK, I've been trying different approaches, but can't seem to get this right.

    I have the image animation working here click the pink circle

    But when I try to add the jQueryColor.js and animate the background color, nothing works. You can see this page here

    Here is what my jQuery script looks like:
    Code:
    <script type="text/javascript">
    	/*<![CDATA[*/
    	$("document").ready(function(){
    $('#circle1').click(function() {
    $('#circle1').animate({
    height: '1200px',
    width: '1200px',
    marginTop:'-500px',
    marginLeft:'-500px'
    }, 1500);
    $('#body_holder').animate({
    backgroundColor: jQuery.Color({'#dad24e'});
    }, 1200);
    });
    });
    </script>

    Does anyone see what I'm doing wrong?
    thanks
    Last edited by lelales; March 6th, 2013 at 02:39 AM. Reason: more info
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    675
    Rep Power
    38

    got it to work


    OK, here's the working product for changing the background color:: click here

    i found the code here
    I couldn't get the plugin to work.
    seems to work pretty well now.

    thanks

IMN logo majestic logo threadwatch logo seochat tools logo