Code xem bài viết ở chế độ toàn màn hình

Code xem bài viết ở chế độ toàn màn hình



1. Đầu tiên chèn css vào template



       .fullpage {position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; z-index: 9999; background-color: rgb(255, 255, 255);overflow-x: hidden;overflow-y: scroll;}
.fullpage-fix-scroll {overflow:hidden;}
#full-page-chiase78{
text-align: center;
padding: 10px;
overflow: hidden;
background: #00a2ff;
border-radius:0 4px 4px 0;
color: #fff;
font-size: 12px;
font-weight: bold;
left: 0;
top: 50px;
z-index: 9999;
}

2. Chèn code dưới vào nơi hiển thị



<a href="#" id="full-page-chiase78">XEM BÀI VIÊT
TOÀN MÀN HÌNH</a>

3. Chèn js dưới vào trước /body là xong


<script>//<![CDATA[
            jQuery(document).ready(function($) {
              $('#full-page-chiase78').click(function(e) {
                $(this).parents('.panel-default').toggleClass('fullpage');
                $('html, body').toggleClass('fullpage-fix-scroll');
                $(this).blur();
                e.preventDefault();
              });
            });

            //]]></script>


thưởng thức nào

4 nhận xét: