zoukankan      html  css  js  c++  java
  • 【HTML】底部弹窗插件代码

    <div class="qqqun">
        <div class="qqtitle">
            <img src="/">点滴记忆       <a class="iconfont layui-icon layui-icon-close "></a>
        </div>
        <a class="qqqcontent" href="https://www.cnblogs.com/HGNET/" target="_blank">
            <div class="right">
                <p>欢迎访问点滴记忆!请收藏本站域名:https://www.cnblogs.com/HGNET/</p>
            </div>
        </a>
        <div class="qqqfooter">
            <a href="https://www.cnblogs.com/HGNET/" target="_blank">立即查看</a>
        </div>
    </div>
         
    <style>
    .layui-icon {
        font-family: layui-icon!important;
        font-size: 16px;
        font-style: normal;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    @media screen and (max- 800px) {
    .qqqun {
        display: none;
    }}
    .qqqun {
        width: 249px;
        height: 180px;
        background: #FFF;
        position: fixed;
        bottom: 0;
        right: 0;
        z-index: 99999999999999999999999999999;
    }
    .qqtitle {
        background: #5298ff;
        height: 37px;
        line-height: 37px;
        color: #FFF;
        padding: 0px 16px;
    }
    .qqqcontent {
        height: 109px;
        padding: 12px 12px;
        display: block;
    }
    .qqqfooter {
        height: 34px;
        line-height: 34px;
        border-top: 1px solid #F6F6F6;
    }
    .qqtitle img {
        width: 18px;
        height: 18px;
        margin-right: 7px;
        vertical-align: middle;
        margin-top: -2px;
    }
    .qqtitle a {
        color: #FFF;
        float: right;
        cursor: pointer;
        font-size: 15px;
        height: 37px;
        line-height: 37px;
    }
    .qqqcontent .right {
        margin-left: 12px;
        width: calc(100%);
    }
    .qqqcontent .right h3 {
        font-size: 14px;
        color: #333;
        height: 20px;
        overflow: hidden;
        width: 100%;
    }
    .qqqcontent .right p {
        color: #9d9d9d;
        font-size: 12px;
        margin-top: 4px;
        line-height: 20px;
        height: 60px;
        overflow: hidden;
        width: 100%;
    }
    .qqqfooter a {
        float: right;
        margin-right: 20px;
        color: #5298ff;
        font-size: 12px;
    }</style>
    
    <script type="text/javascript">
    layui.use('layer', function() {
        var layer = layui.layer;
        $(".jc_list li a").hover(function() {
            if ($(this).attr("title") != '') {
                layer.tips($(this).attr("title"), $(this).parent("li"), { area: ["auto"], tips: [1, '#313333'] });
            }
        }, function() {
            layer.closeAll();
        });
    
    });
    var DangQian = 0;
    $(function () {
        console.log(DangQian+=parseInt($(window).scrollTop()));
        if($(".layui-fixbar-top").length > 0) {
            backtopS();
            $(window).scroll(function(e) {
                backtopS();
            });
            function backtopS(){
                var scroH = $(this).scrollTop();
                var footerHeight = 0;
                if($('.footer').length > 0) {
                    mTop = $('.footer')[0].offsetTop;
                    footerHeight = footerHeight + $(".footer").outerHeight();
                } else {
                    mTop = $('footer')[0].offsetTop;
                }
                footerHeight = footerHeight + $(".footer").outerHeight() + parseInt($(".index").css("margin-top"));
                sTop = $(window).scrollTop();
                result = mTop - sTop - parseInt($(".index").css("margin-top"));
                if(scroH > 200) {
                    $(".layui-fixbar-top").fadeIn(400);
                    if(scroH >= $("body").height() - $(window).height() - footerHeight) {
                        $(".layui-fixbar-top").css("bottom", $(window).height() - result);
                        if (scroH>=3410){
                            $(".layui-fixbar-top").css("margin-bottom", $('footer').height());
                        }else {
                            $(".layui-fixbar-top").css("margin-bottom", "");
                        }
                    } else {
                        $(".layui-fixbar-top").css("bottom", "");
                    }
                } else {
                    $(".layui-fixbar-top").fadeOut(400);
                }
            }
        }
        $(".layui-fixbar-top").click(function(e) {
            $('body,html').animate({
                scrollTop: 0
            }, 800);
        });
        $(".qqtitle").click(function(e) {
            $(".qqqun").slideUp();
        });
        var indexWidth = 0;
        $('#m_huabox li').each(function () {
            indexWidth+=parseInt($(this).width())+18.2;
        });
        $('#m_huabox').css('width',indexWidth);
        $(".header-seac").on('click',function () {
            var title = $(".sear-inp").val();
            if (title){
                window.location.href = "/search?title="+title;
            }
        });
    });
    $(document).keydown(function(event){
        if(event.keyCode == 13){
            var title = $(".sear-inp").val();
            if (title){
                window.location.href = "/search?title="+title;
            }
        }
    });
     </script>
    </div>

    效果:

  • 相关阅读:
    Google Plus 是什么?Google+让Google在线资产在日常生活中更普及
    再谈JavaScript的数据类型问题
    [置顶]信息发布系统 Jquery+MVC架构开发(5)DAL层
    Android:一个简单查询界面的实现
    定制圆角带背景色的矩形边框
    提高c#位图操作的速度[抄袭之作]
    使用XmlTextWriter和XmlTextReader操作Xml文件
    使用Mutex实现单程序实例
    单例模式实现延迟加载
    A记录、MX记录、CNAME 记录、URL转发、NS记录解释
  • 原文地址:https://www.cnblogs.com/HGNET/p/13396385.html
Copyright © 2011-2022 走看看