jq 实现头像(气泡式浮动)

 

前提:假设每个头像都装在li中。

    function headMove() {
            $('li').each(function () {
                var myLeft = Math.floor(Math.random()*(myWidth+1))-128;
                var myTop = Math.floor(Math.random()*(myHeight+1))-128;
                if (myLeft < 0) {
                    myLeft = 0;
                }
                if (myTop < 0) {
                    myTop = 0;
                }
                $(this).animate({left:myLeft,top:myTop},15000,'linear')
            })
        }

 

相关文章:

  • 2022-03-09
  • 2021-12-18
  • 2021-12-06
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-05-21
猜你喜欢
  • 2021-06-26
  • 2021-08-12
  • 2021-06-24
  • 2021-08-25
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案