0

我知道这类似于另一个堆栈溢出帖子,但它没有回答我的问题jquery .animate different speed

这是我的js

$.fx.speeds._default = 1000;

$(function () {
    $("#tabs").tabs();
});

function social() {
    $(document).ready(function () {
        $(".info7").hide();
        $("#social_media").show("fade");
        $("#hide").show();
    });
}

function social_hide() {
    $(document).ready(function () {
        $(".info7").show();
        $("#social_media").hide("fade");
        $("#hide").hide();
    });
}

<!--
if (screen.width <= 800) {
    document.location = "iphone-website.php";
}
//-->

//tipsy popup code

$(function () {
    $('.info').tipsy({fade:true, gravity:'s', fallback:"Use the different search engines to find what you're looking for, These search engines search leagucraft.com and mobafire.com for the information you need."});
    $('.info2').tipsy({fade:true, gravity:'s', fallback:"Click this to open the search engine box in another window."});
    $('.info3').tipsy({fade:true, gravity:'s', fallback:"You can put your user name here instead."});
    $('.info4').tipsy({fade:true, gravity:'s', fallback:"League of Legends InfoMatic Blog."});
    $('.info5').tipsy({fade:true, gravity:'s', fallback:"League of Legends InfoMatic Facebook page."});
    $('.info6').tipsy({fade:true, gravity:'s', fallback:"This website is mobile browser friendly!"});
    $('.info7').tipsy({fade:true, gravity:'s', fallback:"Click here to show the social media buttons."});
    $('.info8').tipsy({fade:true, gravity:'s', fallback:"Click here to hide the social media buttons."});
});

function init() {
    $(document).ready(function () {
        $("body").show("fade");
    });
}

出于某种原因,即使我把 $.fx.speeds._default = 1000; 在每个 jquery 函数或 w/e 背后,它们的速度仍然不同。

4

1 回答 1

1

动画使用计时器来避免阻塞 UI 并模拟“异步事件”。

根据J.Resig 的帖子

如果计时器被阻止立即执行,它将被延迟到下一个可能的执行点(这将比所需的延迟更长)。

因此,计时器并不精确

于 2012-05-23T20:11:52.220 回答