简体   繁体   中英

jQuery fx speeds are different speeds

I know this is similar to another stack overflow post but it didn't answer my question jquery .animate different speeds

Here is my 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");
    });
}

and for some reason even if I put $.fx.speeds._default = 1000; behind every jquery function or w/e they are all still different speeds.

Animations use timers to avoid blocking the UI and simulate "asynchronous events".

According to J.Resig's post

If a timer is blocked from immediately executing it will be delayed until the next possible point of execution (which will be longer than the desired delay).

Therefore, timers are not exact

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM