Tagged: x
-
AuthorPosts
-
August 20, 2016 at 10:16 pm #1139965
yhshin1020ParticipantHey,
I am using a custom Js to make the color of the background fade in and out as the user scrolls down the section.
I’ve included these codes in my css:
.supporthead{ height: 100vh; padding-left: 7%; padding-right: 7%; display: flex; align-items: center; justify-content: center; background-color: #FF006B !important; } .supporthead .scrolled { background: black !important; }This is in my JS:
jQuery(function($) { $('.page-id-1234 input[name="_wpcf7_checkbox_free_text_id:nation"]').attr('placeholder','Please Specify'); $('.page-id-1234 input[name="_wpcf7_checkbox_free_text_id:lang"]').attr('placeholder','Please Specify'); $(window).scroll(function () { if($(document).scrollTop()>200){ $('.supporthead').addClass('scrolled'); } else { $('.supporthead').removeClass('scrolled'); } }); });I’ve tried this and it doesnt seem to work.
Am i doing something wrong here?
Thanks
August 20, 2016 at 10:17 pm #1139967
yhshin1020ParticipantThis reply has been marked as private.August 21, 2016 at 6:05 am #1140242
RadModeratorHi there,
Please change your CSS to this,
.supporthead{ height: 100vh; padding-left: 7%; padding-right: 7%; display: flex; align-items: center; justify-content: center; background-color: #FF006B !important; transition: all 2s; } .supporthead.scrolled { background: black !important; }That should do it 🙂
Cheers!
August 21, 2016 at 10:37 am #1140411
yhshin1020ParticipantThis reply has been marked as private.August 21, 2016 at 12:21 pm #1140498
ThaiModeratorYou’re most welcome 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1139965 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
