Instagram Feed Feed with Grid Rotator.js

时间:2014-04-24 13:58:15

标签: jquery html feed instagram

<script type="text/javascript">
var userFeed = new Instafeed({
    get: 'user',
    userId: **********,
    accessToken: '*************',
       template: '<a href="{{link}}"><img src="{{image}}" /></a>'

});

userFeed.run();
$('#instafeed').cycle({
    fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
});

 
    <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/jquery.gridrotator.js"></script>

    <script type="text/javascript"> 
        $(function() {
$( '#instafeed' ).gridrotator( {
                animSpeed : 300,
                animType : 'rotateBottom',
                w320 : {
                    rows : 3,
                    columns : 4
                },
                w240 : {
                    rows : 3,
                    columns : 3
                },
                slideshow : false,
                onhover : true
            } );

    </script>

我试图创建一个具有旋转效果的Instagram Feed,所以我使用了instafeed.js和gridrotator.js,但它似乎无法正常工作。我有安全的工作,但不是电动旋转器。

1 个答案:

答案 0 :(得分:1)

它对我有用:

var feed = new Instafeed({
    clientId: '***********',
    get: 'tagged',
    tagName: 'food',
    resolution: 'standard_resolution',
    sortBy: 'most-recent',
    limit: 60,
    template: '<li class="square-insta"><a href="{{link}}"><img src="{{image}}" /></a></li>',
    after: function() {
        $( '#ri-grid' ).gridrotator( {
            rows        : 4,
            columns     : 5,
            animType    : 'fadeInOut',
            animSpeed   : 1000,
            interval    : 600,
            step        : 1,
            w320        : {
                rows    : 3,
                columns : 4
            },
            w240        : {
                rows    : 3,
                columns : 4
            }
        } );
    }
});

feed.run();

你的HTML:

<section class="instagram ri-grid ri-grid-size-2" id="ri-grid">

          <ul id="instafeed">

          </ul>
</section>