orapouso / fox-angular-scrollReveal.js

Angular directive to allow the use of scrollReveal.js project
MIT License
31 stars 7 forks source link

Content disappearing. #2

Closed murderart closed 10 years ago

murderart commented 10 years ago

Hi

First off all, thank you for this awesome angularJS directive. I have noticed a little bug. Sometimes the content on the page disappears after it has been moved around with scrollReveal. It only happens once in a while, so I have no clue what could be the reason for this.

Thanks in advance.

Christiaan

orapouso commented 10 years ago

The content of the entire page is disappearing, or just the scrollReveal block? Can you provide a demo/plnkr of the code you are using?

murderart commented 10 years ago

Only the scrollReveal block is disappearing. Sometimes it works like a charm, but when I refresh the page, or change the partial, the animation starts and after that the scrollReveal block just disappears.

orapouso commented 10 years ago

Well, the only thing the directive does is register the scrollReveal elements so it knows when to fire scrollReveal's init function. If anything is happening after the animation starts, it may be a bug in the scrollReveal itself.

It will be difficult to know without seeing your code/example.

Another thing is that it would be good to test your code without angular, so you can be certain that the bug is in the directive. It may be difficult to do this. The lazy loading of partials in angular prevents anything synchronous to work properly. That's why it needs to be registered first and then fired after all scrollRevelal's elements have been loaded.

murderart commented 10 years ago

Okay. I'll test the code without angular. Thanks for the quick response!

murderart commented 10 years ago

I found the problem, and it has nothing to do with your scrollReveal directive. I used a custom jQuery script to manipulate the DOM, and I didn't create a directive for it. This was the source of all complexes. I created a directive for the script, and now everything's working like a charm. Thanks for your help!

RobbieTheWagner commented 10 years ago

My content is disappearing as well. It does the animation and then disappears.

EmptyPockets commented 10 years ago

I'm having the same issue. It runs the animation and then disappears. (opacity: 0, element still exists)

orapouso commented 10 years ago

Can you provide the code you people are using? It never happened with me. Could it be that something else is influencing the scrollReveal behaviour like murderart found above?

EmptyPockets commented 10 years ago

@orapouso Sorry, I can't share the code I'm working on but I can create plnkr to recreate the issue. Unfortunately, I need to turn in my work today so I'll have to find a different solution temporarily.

I can say that there's nothing really special about the project. I added the container directive to the parent element and the scroll-reveal directive to the children.

Also, possibly not related but it's unclear how to pass in the "custom defaults" expression/object?

RobbieTheWagner commented 10 years ago

If using any JavaScript that isn't wrapped in a directive breaks it, I may have done something to break it. I'm not sure. I am also unaware of anything I did that would throw it off though. If you get a working plunker, I'd definitely be interested in comparing. I abandoned using this, since it did not work for me.

EmptyPockets commented 10 years ago

Almost forgot, here's my post on stackoverflow. Shows just the basic setup. Otherwise, the module is included and it "runs" but has the disappearing issue.

I would be thrilled if there was a quick fix because other solutions aren't nearly as nice/clean. If anyone happens to know something else out there please let me know. Right now, I'm writing a custom directive.

orapouso commented 10 years ago

I managed to make a working example for this directive with the code from the scrollReveal example itself.

http://plnkr.co/edit/HTYndu?p=preview

Se if that helps you understand how it works and how to pass in the "custom defaults" expression/object.

EmptyPockets commented 10 years ago

@orapouso That absolutely helps. Thank you very much. I will attempt to recreate the original problem this week.

I did notice that I didn't set any attributes on the directive in my version. Removing the attributes from your plnkr didn't seem to break it though.

orapouso commented 10 years ago

It is because scrollReveal has defaults for everything. You can just add the attribute and it will work.

I'm closing this issue as I cannot reproduce the problem and it seems people got around it anyway.