Hi Wonderful Webflow Community
I am attempting to use a line of JQuery code to add an attribute to a CMS item based on its class. In the example below I am not actually using a collection list but its the same idea. The code does work, but it only works after I resize the browser window.
Please don’t mind the fact that the site looks rough when the code is actually running lol
<script src=https://code.jquery.com/jquery-1.11.3.min.js></script> <script> $('.Div-Block-2, .green').attr('data-scroll-speed','-5'); </script>
I’m not sure why, but the code does work when I change the width or height of the browser by even 1 pixel after it is live. So when I publish, the code doesnt run immediately, but it does run when I go to inspect the element and the browser width changes. I am #confused
I think it could have something to do with the element with the classes that the code is applied to being “in-view” or not, but I am not sure.
Here is my site Read-Only: Webflow - Parallax Scroll Grid