Endless scroll scroll

I almost finished creating the toggle switch theme below. The theme uses an infinite scroll plugin, and it is great for messages that do not contain flash (photo, text, ...). Video and audio messages use flash, and when endless scrolling kicks download more messages, they do not load in flash messages. I can’t understand why, can anyone help as the deadline expires?

http://penguinenglishlibrary.tumblr.com/

+1
source share
2 answers

Turns out I had to iterate over the messages and call tumblr api to get the code to insert the sound.

I put the code below, hope this helps someone:

  • I have the following html code in a tumblr theme:

    {block: Messages}

    <div id="{PostID}" class="posts {block:Photo}photo-post{/block:Photo} {block:Video}video-post{/block:Video} {block:Audio}audio-post{/block:Audio} {block:Photoset}photoset-post{/block:Photoset}">
    
  • (. ) :

    /* repair audio players*/
    $('.audioplayerinto').each(function(){
        var audioID = $(this).attr("id");
        var $audioPost = $(this);
        $.ajax({
            url: 'http://myblog.tumblr.com/api/read/json?id=' + audioID,
            dataType: 'jsonp',
            timeout: 50000,
            success: function(data){
    
                $audioPost.html(data.posts[0]["audio-player"]);
    
    
                /*
                $audioPost.append('\x3cdiv style=\x22background-color:white;height:30px\x22 class=\x22audio_player\x22\x3e' + data.posts[0]['audio-player'] +'\x3c/div\x3e');
                alert("It worked");
                */
            }
        }
    

:

if($content.infinitescroll) {

    $content.masonry({
        itemSelector: '.posts',
        //columnWidth: 235,
        isAnimated: true
    }),    
    $content.infinitescroll({
        navSelector    : 'div#pagination',  
        nextSelector   : 'div#pagination div#nextPage a', 
        itemSelector   : '.posts',
        loading: {
            finishedMsg: '',
            img: 'http://static.tumblr.com/dbek3sy/pX1lrx8xv/ajax-loader.gif'
        },
        bufferPx       : 500,
        debug          : false,
    },
    // call masonry as a callback.
    function( newElements ) {
+5

ajax , inline script . , .

.find , .load :

jquery: Keep <script> .find()

- JS-, JS, -, .

+2