Vivus.js doesn't work with Mean.js

I am creating a simple animation with vivus.js however it doesn't work. 1st i create svg and give id. Then I create a function:

function vivus(){
    console.log("work")
    new Vivus('Layer_1', {type : "async/ oneByOne/delayed"});

    }

      

I just pass in the element id and then an object with key value pairs. This should work, but I am getting this error in the console:

Uncorrectable error: Vivus [constructor]: parameter 'item' is not associated with an existing id

+3


source to share


1 answer


This error means that Vivus could not find your ID "Layer_1"

You need to name "new Vivus" after the svg tag in your HTML.



Using the window.onload () callback can be a solution for non-inline scripts in external JS files. Otherwise, place the script tag that calls Vivus at the end of your body to work around the error.

+1


source







All Articles