Tagged: x
-
AuthorPosts
-
November 18, 2016 at 11:52 am #1262764
yhshin1020ParticipantHey,
I am trying to recreate the effect here: http://www.dtelepathy.com/work/
Where when you scroll down the opacity of the text decreases and it moves down under the slider and when you scroll up it moves back up.
So far i have created the opacity part:
$(window).scroll(function() { var scroll = $(window).scrollTop(); $('.fadeouttext').css({'opacity':(( 1000-scroll*3 )/1000)}); });I have given the text in my rev slider class fadeouttext and have applied the code above in Customiser, which, applied to my rev slider, works perfectly: it decreases in opacity when you scroll down.
I just need to get the moving part done: i am thinking this is done through margin-top: or top: css, i just cant seem to get it working properly (moving down as user scrolls part).
Any help is appreciated.
I understand if this is outside your scope of support, just thought i might try 🙂
Thanks.
November 18, 2016 at 11:53 am #1262766
yhshin1020ParticipantThis reply has been marked as private.November 18, 2016 at 6:17 pm #1263082
Rue NelModeratorHello There,
Thanks for writing in and the very detailed information. To resolve your issue, you need to move the y location of the element by using a css 2D translation. From the original location of
transform: translate(0px, 0%);to the calculated y location liketransform: translate(0px, 50%);. Perhaps something like this:$(window).scroll(function() { var scroll = $(window).scrollTop(); $('.fadeouttext').css({'opacity':(( 1000-scroll*3 )/1000), 'transform' : translate(0px, (your calculation here) );}); });As this is all custom development, regretfully we won’t be able to assist further. Custom development is outside the scope of our support. We’re happy to provide advice and get you started in the right direction, but you would still be responsible for the implementation.
Hope this helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1262764 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
