stellar.js - stellar js initialise with jquery only -


stellar js requires following data attribute element like:

    <div data-stellar-ratio="2"></div> 

however cannot use inline html on particular site i'd need use jquery.

i tried add data attribute jquery not seem work. have idea why?

    $(window).stellar();      $('.gallery.home .image:nth-child(2)').data('stellar-ratio', '2'); 

you need order stellar() method :

$('.gallery.home .image:nth-child(2)').data('stellar-ratio', '2'); $(window).stellar(); //after data-attribute set... 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -