Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Smoother jQuery Animation

  • 28-06-2015 09:20AM
    #1
    Registered Users, Registered Users 2 Posts: 1,298 ✭✭✭


    Hey everyone, i'm making a little site as a side project to get my head around using ajax requests. The one thing i'm finding is that when the ajax request fires its making the animation on my page slow down and be a bit rigid.

    Anyone know a way around this?

    I've but up the beta so far to test it on a server.

    Click here, to go and check it out if you want.


Comments

  • Registered Users, Registered Users 2 Posts: 12,029 ✭✭✭✭Giblet


    Don't use jQuery to animate this, use CSS transitions & transforms, such as scale.
    .leftcurtain,.rightcurtain
    {
         transition: transform .2s linear;     
         transform-origin: left;
    }
    ..rightcurtain 
    {
        transition-origin:right;
    }
    .leftcurtain.open,.rightcurtain.open
    {
        transform: scaleX(.5);
    }
    
    init = function(){$('.leftcurtain,.rightcurtain').addClass('open');}
    


Advertisement