Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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,027 ✭✭✭✭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