Hướng dẫn thông báo bootstrap
Bước 1: Tạo cấu trúc HTML
Thỏa sức học thiết kế web và lập trình web với tài khoản VIP365 tại website hocwebgiare.com
Đăng ký thành viên VIP365 Thỏa sức học thiết kế web và lập trình web với tài khoản VIP365 tại website hocwebgiare.com
Đăng ký thành viên VIP365 Thỏa sức học thiết kế web và lập trình web với tài khoản VIP365 tại website hocwebgiare.com
Đăng ký thành viên VIP365 Thỏa sức học thiết kế web và lập trình web với tài khoản VIP365 tại website hocwebgiare.com
Bước 2: Định dạng CSS .alert-message{ margin: 20px 0; padding: 20px; border-left: 3px solid #eee; } .alert-message h4{ margin-top: 0; margin-bottom: 5px; } .alert-message p:last-child{ margin-bottom: 0; } .alert-message code{ background-color: #fff; border-radius: 3px; } .alert-message-success{ background-color: #F4FDF0; border-color: #3C763D; } .alert-message-success h4{ color: #3C763D; } .alert-message-danger{ background-color: #fdf7f7; border-color: #d9534f; } .alert-message-danger h4{ color: #d9534f; } .alert-message-warning{ background-color: #fcf8f2; border-color: #f0ad4e; } .alert-message-warning h4{ color: #f0ad4e; } .alert-message-info{ background-color: #f4f8fa; border-color: #5bc0de; } .alert-message-info h4{ color: #5bc0de; } .alert-message-default{ background-color: #EEE; border-color: #B4B4B4; } .alert-message-default h4{ color: #000; } .alert-message-notice{ background-color: #FCFCDD; border-color: #BDBD89; } .alert-message-notice h4{ color: #444; } Bước 3: Gọi thư viện Bootstrap và Font awesome Bước 4: Gọi thư viện JQUERY Bước 5: Tạo chức năng đóng bằng JQUERY $(document).ready(function () { $('.alert-autocloseable-success').hide(); $('.alert-autocloseable-warning').hide(); $('.alert-autocloseable-danger').hide(); $('.alert-autocloseable-info').hide(); $('#autoclosable-btn-success').click(function() { $('#autoclosable-btn-success').prop('disabled', true); $('.alert-autocloseable-success').show(); $('.alert-autocloseable-success').delay(5000).fadeOut( 'slow', function() { $('#autoclosable-btn-success').prop('disabled', false); }); }); $('#normal-btn-success').click(function() { $('.alert-normal-success').show(); }); $('#autoclosable-btn-warning').click(function() { $('#autoclosable-btn-warning').prop('disabled', true); $('.alert-autocloseable-warning').show(); $('.alert-autocloseable-warning').delay(3000).fadeOut( 'slow', function() { $('#autoclosable-btn-warning').prop('disabled', false); }); }); $('#normal-btn-warning').click(function() { $('.alert-normal-warning').show(); }); $('#autoclosable-btn-danger').click(function() { $('#autoclosable-btn-danger').prop('disabled', true); $('.alert-autocloseable-danger').show(); $('.alert-autocloseable-danger').delay(5000).fadeOut( 'slow', function() { $('#autoclosable-btn-danger').prop('disabled', false); }); }); $('#normal-btn-danger').click(function() { $('.alert-normal-danger').show(); }); $('#autoclosable-btn-info').click(function() { $('#autoclosable-btn-info').prop('disabled', true); $('.alert-autocloseable-info').show(); $('.alert-autocloseable-info').delay(6000).fadeOut( 'slow', function() { $('#autoclosable-btn-info').prop('disabled', false); }); }); $('#normal-btn-info').click(function() { $('.alert-normal-info').show(); }); $(document).on('click', '.close', function () { $(this).parent().hide(); }); });
Cách tạo menu bằng Bootstrap (Phần 5)Cách tạo menu bằng Bootstrap (Phần 4)Cách tạo menu bằng Bootstrap (Phần 3)Cách tạo menu bằng Bootstrap (Phần 2)Cách tạo menu bằng Bootstrap (Phần 1)Cách tạo menu Tabs trong Bootstrap (Phần 2)Cách tạo menu Tabs trong Bootstrap (Phần 1)Hướng dẫn cách tạo Button Groups trong Bootstrap (Phần 3)Hướng dẫn cách tạo Button Groups trong Bootstrap (Phần 2)Hướng dẫn cách tạo Button Groups trong Bootstrap (Phần 1)Tìm kiếm phổ biến
|