zoukankan
html css js c++ java
斗鱼的sidebar的实现简陋的demo
斗鱼的sidebar的实现简陋的demo
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8" /> <title></title> <style> .sidebar{ position:fixed; top:0; left:0; background:#f00; } .content{ 200px; background:#666; height:200px; } .left-smcontent{ 57px; display:none; background:#ccc; height:200px; } .small .content{ display:none;} .small .left-smcontent{ display:block;} .small .close{left:57px;} .close{ position:fixed; top:50%; left:200px; display:inline-block; 30px; height:30px; background:red; } .main{margin-left:250px;} </style> </head> <body> <div id="sidebar" class="sidebar"> <div class="content"></div> <div class="left-smcontent"></div> <a href="javascript:;" id="close" class="close"></a> </div> <div class="main" id="main">2222222</div> <script> function $(id){ return document.getElementById(id) } function windowHight(){ return document.documentElement.clientHeight||document.body.clientHeight; } $("sidebar").style.height=windowHight()+"px"; window.onresize=function(){ $("sidebar").style.height=windowHight()+"px"; } $("close").onclick=function(){ if($("sidebar").className=="sidebar small"){ $("sidebar").className="sidebar"; $("main").style.marginLeft="250px" }else{ $("sidebar").className="sidebar small"; $("main").style.marginLeft="57px" } } </script></body> </html>
运行
//因为时间比较紧张,没有对源码进行详细的介绍,在周末的优化的时候都会一一的补上,并且对代码进行优化
2222222
查看全文
相关阅读:
MongoDB优化之一:常见优化方法
Spark Streaming之一:整体介绍
Java中实现MongoDB自增主键ID
RDD之一:总体介绍
对一致性Hash算法,Java代码实现的深入研究
MongoDB 创建基础索引、组合索引、唯一索引以及优化
mongo-查询
MongoTemplate聚合操作
RESTLET开发实例(一)基于JAX-RS的REST服务
Hashtable的实现原理
原文地址:https://www.cnblogs.com/heyinwangchuan/p/6003922.html
最新文章
[转]教你如何在博客园放“可运行"代码
[转]Using the Interop Activity in a .NET Framework 4 Workflow
[转]WF事件驱动
[转]访问 OData 服务 (WCF Data Services)
[转]Open Data Protocol (OData) Basic Tutorial
[转]Windows Azure安全概述
[转]在 Azure 云服务上设计大规模服务的最佳实践
Scala总结
二、Spark在Windows下的环境搭建
一:安装Scala
热门文章
几种简单的负载均衡算法及其Java代码实现
thread-safe之3:SimpleDateFormat安全的时间格式化
HTTP协议中的长连接和短连接(keep-alive状态)
JMeter使用jar进行压力测试
MongoDB优化之三:如何排查MongoDB CPU利用率高的问题
MongoDB优化之二:常见优化方法--待整理
微服务理论之二:面向微服务架构与传统架构、SOA对比,以及云化对比
方法区之三:运行时常量池==了解String类的intern()方法、常量池介绍、常量池从Perm-->Heap
SpringBoot自动化配置之二:自动配置(AutoConfigure)原理、EnableAutoConfiguration、condition
Metaspace 之二--PermGen vs. Metaspace 运行时比较
Copyright © 2011-2022 走看看