Grow your CSS skills. Land your dream job.

JQuery Animation

  • # September 24, 2009 at 3:39 pm

    Hi, I would like to recreate the effect you can see here: http://urbanmandesign.com/tests/animate.php using JQuery. I ask because it isn’t very easy on the browser using this method and I would like it to be a nice clean movement. I would then like to make it more complex for example adding rotation and I feel this could be better achieved with JQuery. So can this be done, and if so how?

    Thanks

    -Tom

    # September 24, 2009 at 8:21 pm

    Something like this works….

    Code:
    $(function (){

    $(“div”).animate({
    bottom: “0px”,
    right: “0px”
    }, 3000 );
    });

    The "bottom" and "right" parameters can be changed to whatever your destination should be.
    The "3000" in the above example is miliseconds, so 3 seconds for it to travel to it’s destination…

    The html for this would need a div with position absolute.

    Note, this is in essence, rapidly changing the CSS of the page, so sometimes it looks a littly sluggish/buggy. Also I don;t think rotation is supported, because css doesn’t natively support rotation (maybe some css3 stuff does, not too sure)

    Rob
    # September 25, 2009 at 5:33 am
    "blue642" wrote:
    Note, this is in essence, rapidly changing the CSS of the page, so sometimes it looks a littly sluggish/buggy. Also I don;t think rotation is supported, because css doesn’t natively support rotation (maybe some css3 stuff does, not too sure)

    yea rotation is beginning to be supported – but yes, IE is probably going to hold back, or rotate in the opposite direction, or maybe just turn your site into a big "lol cat".

    # September 25, 2009 at 6:05 am

    Thanks for your reply, I am going to use that code, and Rob tbh I stopped caring for IE and yeah, you are most likely right – but who cares?!

    Rob
    # September 25, 2009 at 6:24 am

    well unfortunately IE has a huge market share – so you do need to cater for IE users, mainly because most users wont know that the browser they use is a browser, they just think its the internet.

    IE6 can go hang though lol

    # September 25, 2009 at 8:10 am

    Oh yeah I totally agree, all I’m saying is I kow most of the visitors to my site won’t be using IE thereofre I will be focusing more on other, more up to date browsers.

    BTW: The link is now dead

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".