Closed tarek1500 closed 7 years ago
ScrollReveal generates CSS which it uses by applying it to an HTML element’s style
attribute. Before it does this though, it stores the existing style
attribute (one during the reveal()
call), which preserves existing inline styles.
The $().css()
method is also applying CSS via the style
attribute, but like you have noticed, it just gets overwritten with what ScrollReveal has stored because you are changing this dynamically (after ScrollReveal has scanned the element).
I think the simplest solution here is to use ScrollReveal on a parent element instead, (such as .section
) to avoid style
attribute conflicts.
Note: Also, please be sure to update to 3.3.6
for an important bug fix.
Thank you for your comment.
I tried your solution and it is working fine.
Since I have many divs inside the .section
div I wrap each one with div element and apply the ScrollReveal
to this div.
OS: Windows 10 ScrollReview version: 3.3.4 Browser: Chrome Version 58.0.3029.110 (64-bit)
I was trying to make a dynamic CSS change (live preview) using jQuery and add some animation using ScrollReveal. But once I change the font size using the textbox, then scroll down and up, the ScrollReveal delete my dynamic CSS changes. It do all the stuffs fine but it deletes my new font size and back to initial size. Here is my code:
It is supposed to work like that? or I'm doing something wrong?