1234567891011121314151617181920212223242526272829303132 |
- export default {
- data () {
- return {
- animationLoaded: false
- }
- },
- methods: {
- scrollFun() {
- if (!(this.$route.meta.name == 'pages-News-news' || this.$route.meta.name == 'pages-Live-Live' || this.$route.meta.name == 'pages-Videos-index' || this.$route.meta.name == 'pages-game-index')) {
- return
- }
- let pointList = [...this.$('.fadeInRight'), ...this.$('.fadeInLeft'), ...this.$('.fadeInTop'), ...this.$('.fadeInBtm')]
- var scrollTop = this.$(window).scrollTop()
- var scrollHeight = (this.$(window).height() - 150)
- pointList.forEach((item, index) => {
- let ele = this.$(item)
- var height = ele.height()
- var top = (ele.offset().top) - scrollTop
- if (top > 0 && top < (scrollHeight)) {
- if (!(ele.hasClass('animation'))) {
- ele.addClass('animation')
- }
- }
- if (top < 0 && (height + top) > 0) {
- if (!(ele.hasClass('animation'))) {
- ele.addClass('animation')
- }
- }
- })
- }
- }
- }
|