Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeJS, Express, Jade partial views issues #25

Closed
jferrell5 opened this issue Aug 7, 2014 · 5 comments
Closed

NodeJS, Express, Jade partial views issues #25

jferrell5 opened this issue Aug 7, 2014 · 5 comments

Comments

@jferrell5
Copy link

While test driving AniJS on a NodeJS/Express site using the Jade template engine, I have noticed that the animations do not work unless the anijs.js script reference is included directly in the partial view where the html tag to be animated with the "data-anijs" attribute exists. If the anijs script reference is included as part of a layout file(loaded into the page ) the anijs script loads prior to the view file's html, but no animation occurs. If the anijs script reference is included in the partial view, the animations work great. For obvious reasons I would rather have the script reference to anijs in the layout head tag, then just add the "data-anijs" attribute where desired throughout the site's views/partial views as with all other script libraries I am using.

Am I missing something here or is this just the nature of the AniJS library? Good work btw.

@darielnoel
Copy link
Contributor

Hi, thanks for using AniJS, are you skype account? I can check your problem directly right now if you share your desktop through skype? My Skype id is darielnoel.

Regards

@darielnoel
Copy link
Contributor

The AniJS behavior is the below:
1 - The library script is loaded.
2 - By default AniJS travel through the current DOM nodes.

If you add another DOM elements dinamically with new data-anijs sentences after this moment , you need to call the AniJS run function using Javascript.

//Traveled the DOM scope parsing all nodes with data-anijs tag.
AniJS.run();

@jferrell5
Copy link
Author

Thanks Dariel. I added a script file that calls AniJS.run() on window.onload, enabling me to keep a reference to anijs-min.js and any inline scripts out of my Jade partials. I can now just add the animation attributes to the html tags wherever needed.

Thanks again.

@darielnoel
Copy link
Contributor

Cool!!! Good luck :)

@darielnoel
Copy link
Contributor

Hi, we launched AniJS Studio on KickStarter, that allow to designers and programmers add animations and interactions for Web pages in an easy and intuitive way. Please, take a look at the project and if you find it interesting or simply want to help us, you can make a small donation. I would be grateful, Greetings Dariel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants