javascript - 这段代码如何设置成为默认关闭
阿神
阿神 2017-04-10 17:56:03
[JavaScript讨论组]

用了个在线客服代码,但是默认是打开的,我想默认是关闭的
尝试了添加style="display:none;" 结果直接不显示了

代码如下

<p id="box-kefu">

    <p class="kefu-close"></p>
    <p class="kefu-open">
        <p>
        <ul>
            <li><a href="" target="_blank"><i class="qq"></i>在线客服1</a></li>
        </ul>

        </p>
        <a href="javascript:;" class="close">关闭</a>
    </p>
</p>
<script>var online= new Array();</script>
<script src=""></script>
<script>
(function($){
    for (var i=0; i<online.length; i++) {
        if (online[i]) jQuery("#box-kefu .qq").eq(i).addClass("online");
    }
    var _close = $("#box-kefu").find(".kefu-close"),
        _open = $("#box-kefu").find(".kefu-open");
    _open.find("a").hover(function(){
        $(this).stop(true,true).animate({paddingLeft:20},200).find("i").stop(true,true).animate({left:75},200);
    },function(){
        $(this).stop(true,true).animate({paddingLeft:35},200).find("i").stop(true,true).animate({left:10},200);
    });

_open.find(".close").click(function(){
        _open.animate({width:148},200,function(){
            _open.animate({width:0},200,function(){
                _close.animate({width:34},200);

            });
        });
    });
    _close.click(function(){
        _close.animate({width:44},200,function(){
            _close.animate({width:0},200,function(){
                _open.animate({width:138},200);
            });
        });
    });
})(jQuery)
</script>
<p style="text-align:center;clear:both">
阿神
阿神

闭关修行中......

全部回复(2)
阿神

两种方法,任选其一

PHP中文网

p默认close怎么设置!

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号