dmotz / oriDomi

🪭 Fold up DOM elements like paper
https://oxism.com/oriDomi
MIT License
2.41k stars 207 forks source link

jQuery: oriDomi is not a function #42

Closed iandevlin closed 9 years ago

iandevlin commented 9 years ago

I am trying to get this working with jQuery, and keep getting that great jQuery error "oriDomi is not a function".

I have included the oridomi.min.js file and confirmed that the path is correct, but as soon as I call oriDomi() with a selector (for items that I can confirm are there), I get this error. The code is within a click handler:

$('container').on('click', '.item', function () {
   $folded = $(this).find('.member-info').oriDomi();
});

It is my understanding from the documentation that I should not need to do anything special to get it working with jQuery, that the library itself works out if jQuery is being used or not and will act accordingly.

Am I missing something here?

dmotz commented 9 years ago

Your code should work. Are you making sure to load jQuery on the page before OriDomi?

If it's still not working, link to a demo so I can get a better idea.

iandevlin commented 9 years ago

Yes, jQuery is indeed being called before OriDomi, I thought I had mentioned that previously, but I see that I did not.

It still doesn't work, but unfortunately I am unable to link to any demo, I just wanted to check that what I was doing was right. Thanks.