在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML5  HTML/ 怎么把這段js代碼轉(zhuǎn)換成jquery代碼

怎么把這段js代碼轉(zhuǎn)換成jquery代碼

function alertSet(e) {
    document.getElementById("js-alert-box").style.display = "block",
    document.getElementById("js-alert-head").innerHTML = e;
    var t = 20,
    n = document.getElementById("js-sec-circle");
    document.getElementById("js-sec-text").innerHTML = t,
    setInterval(function() {
        if (0 == t){
            location.;
        }else {
            t -= 1,
            document.getElementById("js-sec-text").innerHTML = t;
            var e = Math.round(t / 20 * 735);
            n.style.strokeDashoffset = e - 735
        }
    },
    970);
}
回答
編輯回答
鹿惑

不考慮你代碼的任何邏輯,對錯:

function alertSet(e) {
        $("#js-alert-box").show();
        $("#js-alert-head").html(e);
        var t = 20, n = $("#js-sec-circle");
        $("#js-sec-text").html(t);
        setInterval(function () {
            if (0 === t) {
                location.;
            } else {
                t -= 1;
                $("#js-sec-text").html(t);
                n.css('stroke-dashoffset', Math.round(t / 20 * 735) - 735);
            }
        },
        970);
    }

順便說一線,js可以省略結(jié)束的分好,但是結(jié)束不是逗號。

2018年9月4日 00:50
編輯回答
浪婳

這是我的想法,希望能對你有所幫助:

function alertSet(e) {
        $("#js-alert-box").show();
        $("#js-alert-head").html(e);
        var t = 20, $n = $("#js-sec-circle");
        $("#js-sec-text").html(t);
        setInterval(function () {
            if (0 === t) {
                window.location.;
            } else {
                t -= 1;
                $("#js-sec-text").html(t);
                $n.css('stroke-dashoffset', Math.round(t / 20 * 735) - 735);
            }
        },
        970);
    }
2017年5月23日 17:12
編輯回答
負(fù)我心
function alertSet(e){
  $("#js-alert-box").css("display","block");
  $("#js-alert-head").html(e);
  var t = 20;
  var $n = $("#js-sec-circle");
  setInterval(function(){
    if(t == 0){
      location.;
    }else{
      t -= 1,
      $("#js-sec-text").html(t);
      var e = Math.round(t / 20 * 735);
      $n.css("strokeDashoffset",e - 735); 
    }
  },970)
}
2018年4月13日 01:36
編輯回答
帥到炸
function alertSet(e) {
    $("#js-alert-box").show(),
    $("#js-alert-head").html(e);
    var t = 20,
    n = $("#js-sec-circle");
    $("#js-sec-text").html(t),
    setInterval(function() {
        if (0 == t){
            location.;
        }else {
            t -= 1,
            $("#js-sec-text").html(t);
            var e = Math.round(t / 20 * 735);
            n.css({strokeDashoffset: e - 735})
        }
    },
    970);
}
2018年5月28日 22:27