jQuery ล่าช้า ()วิธี การ

❮ วิธีการเอฟเฟกต์ jQuery

ตัวอย่าง

หน่วงเวลาองค์ประกอบ <div> ที่แตกต่างกัน:

$("button").click(function(){
  $("#div1").delay("slow").fadeIn();
  $("#div2").delay("fast").fadeIn();
});

ความหมายและการใช้งาน

วิธีการล่าช้า () ตั้งเวลาเพื่อชะลอการดำเนินการของรายการถัดไปในคิว


ไวยากรณ์

$(selector).delay(speed,queueName)

Parameter Description
speed Optional. Specifies the speed of the delay

Possible values:

  • milliseconds
  • "slow"
  • "fast"
queueName Optional. Specifies the name of the queue

Default is "fx", the standard effects queue

ลองด้วยตัวคุณเอง - ตัวอย่าง


วิธีหน่วงแอนิเมชั่น


❮ วิธีการเอฟเฟกต์ jQuery