Search code examples
javascriptfootersliding

Sliding photos inside footer wordpress


I have about 30 different logos and I have to put them all in the footer which should slide those images like in this page footer http://laravel.com/, where background is slowly sliding by. How I can do that?


Solution

  • you can use this code with jQuery:

    HTML :

    <div id="silde">
    </div>
    

    CSS:

    #silde{
        height:191px;
        width:100%;
        background-image: url(http://laravel.com/assets/img/quotes.jpg);
        background-position: 0 0;
    }
    

    Js:

    $(document).ready(function(){
        var posi = 0 ;
        setInterval(function(){
            posi++;
            $("#silde").css("background-position",posi+'px 0');
            }, 200);
    });
    

    and you can use posi++ to move right, posi-- to move left. and you can see the sample here: http://jsfiddle.net/4bbykut3/1/