页面悬浮窗(点击展开或者收缩)

摘要:
Html代码:1<divclass=“switch”>2<dlclass=“clearFix”>3<dtclass=“fl”>我将尝试5</dt>6<ddclass=“f1”>7</dd>8</dl>9</div>css代码:1。switch{position:absolute;right:0;top:100px;height:400px;溢出:隐藏;光标:指针;}2.switchdt{width:30px;padding:100px10px;height:200px;text-align:center;font-size:20px;color:#fff;background:#45b035;}3.switchdd{width:0px;height:400px;background:url;}Js代码:$。onfunctionSwitch{if{$.animate;}否则{$.animate;}}效果如下:

html代码:

1 <div class="switch">
2     <dl class="clearFix">
3         <dt class="fl">
4             点我试试
5         </dt>
6             <dd class="fl">
7             </dd>
8     </dl>
9 </div>

css代码:

1 .switch{position:absolute;right:0;top:100px;height:400px;overflow: hidden;cursor: pointer;}
2 .switch dt{width: 30px;padding:100px 10px;height: 200px;text-align:center;font-size: 20px;color: #fff;background: #45b035;}
3 .switch dd{width: 0px;height: 400px;background: url(img01/11.jpg);}

js代码:

<script type="text/javascript">
    $("dt").on("click",function(){
        Switch(".switch dd");                        
    })
    function Switch(Obj){
        if($(Obj).width()==0){
            $(Obj).animate({
                width:"400px"
            },1000);
        }else{
            $(Obj).animate({
                width:"0px"
            },1000);
        }
    }
</script>

效果如下:

页面悬浮窗(点击展开或者收缩)第1张

页面悬浮窗(点击展开或者收缩)第2张

免责声明:文章转载自《页面悬浮窗(点击展开或者收缩)》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇[0] C#软件项目版本号的命名规则及格式介绍android调试工具DDMS下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

随便看看

webstorm关闭烦人的eslint语法检查

使用eslint语法检查后,我们发现JS代码中到处都是红线。通过右键菜单中的fixeslint problems选项,我们可以发现页面代码格式完全被eslint包装。只需关闭exlint语法检查。看不见,想不起来。反向关闭不会影响代码开发,但相反,它会影响代码开发。关闭eslint位置:文件--˃设置--˃语言和框架--˃CodeQualityTools--...

bootstrap删除模态框弹出并询问是否删除【通用删除模态框】

divclass=“模态对话框”&gt;divclass=“modal header”&gt;spanaria hidden=“true”&gt;h4class=“模态标题”&gt;divclass=“modal body”&gt;divclass=“模态页脚”&gt;...

PB各对象常用事件

1.触发窗口中事件名称的时间01.在激活窗口之前激活触发器02。单击触发器03.Close触发器04.CloseQuery在窗口被清除或关闭时触发。...

异步复位和同步释放电路的详细解释

我发现互联网上很多关于异步重置和同步释放的解释都是错误的。以下解释非常清楚。转移自:http://www.xue5.com/Developer/Software/665219.html如图所示,第一个盒子包含异步复位和同步释放电路。第一级D触发器的输入是VCC,第二级触发器的输出是可以异步复位和同步释放的复位信号。所谓异步复位和同步释放是指复位信号是异步和有...

解决curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to raw.githubusercontent.com:443 错误

报告命令curl-o时出错-https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh| bash错误状态的原因是未安装git。使用以下命令安装git,然后执行上面的命令sudoapt-geinstallgit-referencehttps://www.pianshen.com/articl...

iOS NSString 与NSData转化

1.将字符串转换为DataNSString*str=@“str”;NSUTF8StringEncoding];数据编码:char*haha=[数据字节];NSData*content=[NSDatadataWithBytes:byteDatalength:16];...