美文网首页
pc端的跟随鼠标事件和大屏幕缩放、tweenmax使用

pc端的跟随鼠标事件和大屏幕缩放、tweenmax使用

作者: guoss | 来源:发表于2019-07-16 13:23 被阅读0次

1.鼠标跟随立绘事件
https://github.com/Anngisa/problem-in-coding/commit/6163fd8bf0d7d62487cb0e1b4f0322c4a8a90115

  1. 屏幕的缩放
const initScale = function () {
  let winW = $(window).width() < 1400 ? 1400 : $(window).width()
  let radio = winW / 1900
  radio = radio > 1 ? 1 : radio
  $('#loadingpart, .wrap').css({
    '-webkit-transform': `scale(${radio}, ${radio})`,
    '-moz-transform': `scale(${radio}, ${radio})`,
    '-o-transform': `scale(${radio}, ${radio})`,
    '-ms-transform': `scale(${radio}, ${radio})`,
    'transform': `scale(${radio}, ${radio})`,
    '-webkit-transform-origin': 'top left',
    'transform-origin': 'top left'
  })

  $('#footer-wrap').height(radio*1560);
}

3.tweemax 使用
https://github.com/Anngisa/problem-in-coding/blob/master/tweenmax%20%E4%BD%BF%E7%94%A8

相关文章

网友评论

      本文标题:pc端的跟随鼠标事件和大屏幕缩放、tweenmax使用

      本文链接:https://www.haomeiwen.com/subject/pewzkctx.html