Code đếm ngược lấy Pass giải nén
Xem Thêm : Căn hộ mini là gì?
Hướng dẫn code đếm ngược lấy pass giải nén – Thấy nhiều anh em thường xuyên search từ khóa này, nhưng trên mạng lại không hiển thị đúng kết quả mong muốn. Trong bài viết này Toancr xin chia sẽ mẫu code đếm ngược thời gian hiển thị pass như dưới đây.
Mục lục bài viết
Bước 1: Chuẩn bị nội dung html
<div class="matkhaugiainen"> <input id="laypass" class="laymk" type="button" value="Lấy Pass giải nén"><br> <span id="hienpass" class="doimk hienmk">Đợi xem Pass</span> </div>
Bước 2: Chuẩn bị đoạn JavaScript
<script> jQuery(document).ready(function ($) { function toancr(min, max){ return Math.floor(Math.random() * (max - min)) + min; } var timeout = null; var s = toancr (65, 85); //55, 75 function demnguoc(){ $("#laypass").addClass("nhanvao"); $("#hienpass").addClass("hienmatkhau"); $("#hienpass").html(s); if (s == -1){ clearTimeout(timeout); $("#hienpass").html("Pass giải nén: toancr.com"); return false; } timeout = setTimeout(function(){ s--; demnguoc(); }, 1000); } $(document).on("click", "#laypass", function(){ demnguoc(); }); }); </script>
Bước 3: Thêm 1 ít CSS cho đẹp mắt nhé
.laymk, .hienmk { background: red !important; color: white !important; font-size: 15px !important; font-weight: 700 !important; padding: 5px 10px !important; border: none !important; border-radius: 5px !important; } .doimk {display: none;} .hienmatkhau {display: inline-block !important;} .matkhaugiainen .nhanvao {display: none !important;}
Hy vọng những thông tin này sẽ có ích cho bạn. Chúc các bạn thành công!
Bạn Đang Xem: Code đếm ngược lấy Pass giải nén
Source: https://toancr.com/
Category: Tin Tức
Anh ơi cho em hỏi, e đang dùng wordpress thì mấy code này dán ở đâu ạ. Em cảm ơn.
em có thể dán vào widget để dễ chỉnh sửa
e cảm ơn ạ