Help Code đặt banner lớn bên phải như vnxf

phankt

Corporal
Tham gia
23/08/2016
Bài viết
116
Được Like
25
Chào mọi người.
Em tìm mấy ngày nay nhưng không tìm ra code css để treo 1 banner như diễn đàn vnxf.vn.
upload_2016-9-7_22-32-7.png


Em hi vọng đươc mọi người trợ giúp.

Xin cảm ơn mọi người!
 
  • Like
Reactions: THB

THB

Founder
Thành viên BQT
Tham gia
25/02/2015
Bài viết
6,646
Được Like
3,931
đây bác. chèn vào template ad_sidebar_bottom nhé. thay đường dẫn nhé
PHP:
<xen:hook name="ad_sidebar_bottom" />
<div class="bnbreak"></div>
<div class="section rightside">
<div class="secondaryContent statsList" style="padding: 0">
    <div style='height:600px; width:290px;margin: 0 auto'>
<a href="http://muabanraovatphuquoc.com/index.php" target="_blank" ref="dofollow">
<img src="http://vnxf.vn/anh/BANNER300600.jpg" border="0" width="100%" class="img_ad"></a>
    </div>       
  </div>
</div>

    <script type='text/javascript'>
    var lht = window.location.href;
    //if(lht.indexOf('.t') != -1) {
    $(window).bind("scroll", function () {
        var banner = $(".rightside");
        var diemdau = $(".bnbreak").offset().top;
        var diemcuoi = $(".footer").offset().top - 140;
        var trang = $(".mainContainer");
        var cuoitrang = trang.offset().top + trang.height();
        var cuoibanner = banner.offset().top + banner.height();
        if ($(this).scrollTop() > diemdau && cuoibanner < cuoitrang) {
            if($(this).scrollTop() < diemcuoi - banner.height()) {
                banner.css({top: 5, position: 'fixed'});
            } else {
                banner.css({position: 'fixed', top: diemcuoi - $(this).scrollTop() - banner.height() - 18, width: 300});
            }
        } else {
            banner.css({position: 'static', top: ''});
        }
    }) 
    //} else $(".rightside").hide();
    </script>
 

phankt

Corporal
Tham gia
23/08/2016
Bài viết
116
Được Like
25
Cảm ơn bác em làm được rồi. inlove~~
 
  • Like
Reactions: THB

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mobile/Zalo: 0906081284

Telegram: anhanhxf

Chỉ nhận web nội dung lành mạnh

Nhà Tài Trợ

Mút Xốp Không Gian
Mút Sofa Không Gian
Top Bottom