Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- export default {
- data() {
- return {
- isActive: true,
- isScrolled: false
- }
- },
- created() {
- this.scrollListener();
- },
- methods: {
- toggleActive() {
- this.isActive = !this.isActive;
- },
- toggleScroll(){
- alert('done');
- },
- scrollListener(){
- window.addEventListener("scrollTop", function(){
- if ($(window).scrollTop() > 10) {
- this.isScrolled = true;
- }
- else if ($(window).scrollTop() < 10) {
- this.isScrolled = false;
- }
- })
- }
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement