JS定位移动到顶角

js positioning moving to top corner

本文关键字:移动 定位 JS      更新时间:2023-09-26

我一直在寻找答案,一切似乎都会导致这段代码可以工作。任何想法为什么不呢?

$('.entertext').click(function(){
    $('.entertext').animate({opacity:0});
        //$('.move').animate({top:200, left:350});
        //$('.move').animate({top:0, left:0});
    $('.move').animate({"left": "-=350px", "top": "-=200px"});
        if ($('.move').left > 50) {
            $('.homepage').animate({opacity:1.0});
        }
    //$(this).animate({left:100});
});

替换$('.move').left

$('.move').offset().left

或者$('.move').css('left'),具体取决于您的需要。