Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <script>
  2. export default {
  3. data() {
  4. return {
  5. isActive: true,
  6. isScrolled: false
  7. }
  8. },
  9.  
  10. created() {
  11. this.scrollListener();
  12. },
  13. methods: {
  14. toggleActive() {
  15. this.isActive = !this.isActive;
  16. },
  17.  
  18. toggleScroll(){
  19. alert('done');
  20.  
  21. },
  22.  
  23. scrollListener(){
  24. window.addEventListener("scrollTop", function(){
  25. if ($(window).scrollTop() > 10) {
  26. this.isScrolled = true;
  27. }
  28. else if ($(window).scrollTop() < 10) {
  29. this.isScrolled = false;
  30. }
  31. })
  32. }
  33. }
  34.  
  35. }
  36. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement