Question

I am working with turn.js, however i am getting the error TypeError: $(...).turn is not a function currently my js is:

function loadApp() {
   // Create the flipbook
   $('.flipbook').turn({
        // Width
        width:922,

        // Height
        height:600,

        // Elevation
        elevation: 50,

        // Enable gradients
        gradients: true,

        // Auto center this flipbook
        autoCenter: true
   });
}

// Load the HTML4 version if there's not CSS transform
$(document).ready(function() {  
   yepnope({
      test : Modernizr.csstransforms,
      yep: ['../../lib/turn.js'],
      nope: ['../../lib/turn.html4.min.js'],
      both: ['css/basic.css'],
      complete: loadApp
   });
});

Any ideas where i could be going wrong?

Was it helpful?

Solution

Is difficult to give just one answer, because there's a number of things that could be wrong here. But, I think that the problem should be that either jQuery or turn.js is not being loaded correctly.

So, I'd suggest that, first of all, you open the developer tools of the browser of your choice and check if jQuery and turn.js are indeed being loaded into the page. Also jQuery must be before turn.js in order for turn.js to work properly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top