jQuery Effect show () Phương thức

❮ Phương thức hiệu ứng jQuery

Thí dụ

Hiển thị tất cả các phần tử <p> bị ẩn:

$("button").click(function(){
  $("p").show();
});

Định nghĩa và Cách sử dụng

Phương thức show () hiển thị các phần tử được chọn, ẩn.

Lưu ý: show () hoạt động trên các phần tử ẩn bằng các phương thức jQuery và hiển thị: không có trong CSS (nhưng không hiển thị: ẩn).

Mẹo: Để ẩn các phần tử, hãy xem phương thức hide () .


Cú pháp

$(selector).show(speed,easing,callback)

Parameter Description
speed Optional. Specifies the speed of the show effect. Default value is 400 milliseconds

Possible values:

  • milliseconds
  • "slow"
  • "fast"
easing Optional. Specifies the speed of the element in different points of the animation. Default value is "swing"

Possible values:

  • "swing" - moves slower at the beginning/end, but faster in the middle
  • "linear" - moves in a constant speed
Tip: More easing functions are available in external plugins
callback Optional. A function to be executed after the show() method is completed

To learn more about callback, visit our jQuery Callback chapter


Hãy tự mình thử - Ví dụ


Cách sử dụng tham số tốc độ khi ẩn / hiện một phần tử.


Cách sử dụng tham số gọi lại khi ẩn / hiển thị một phần tử.


❮ Phương thức hiệu ứng jQuery