jquerybookblock

Bookblock jquery pluin


There is a demo of the BookBlock jquery plugin on this page:

http://tympanus.net/Development/BookBlock/

I am using this code after the page has loaded:

$.getScript('//www.mysite.com/modernizr.custom.js'); 
$.getScript('//www.mysite.com/jquerypp.custom.js'); 
$.getScript('//www.mysite.com/jquery.bookblock.js'); 
HTMLtoAppend="<div class='bb-item'><a href="example.com">';
HTMLtoAppend+='<img src="example.jpg" width="400" height="300"></a></div>';
$('#bb-bookblock').append(HTMLtoAppend);
$('#bb-bookblock').bookblock();
$('#bb-next').on('click', function() { $( '#bb-bookblock').bookblock('next') });
$('#bb-prev').on('click', function() { $( '#bb-bookblock').bookblock('prev') });

The image appears no proble, the HTML is appended nicely, but the plugin will not work.

Any help would be appreciated.


Solution

  • To wrap this up, I could not get the plugin to run using the code stated on the demo page:

    $( '#bb-bookblock' ).bookblock(); //initialization
    

    It would only run by including the copious inline javascript.