JS实现拖拽和拉伸的实例

 进去的页面这个样子,其中可以左右,上下移动,进行拖拽,也可以点击进行页面的隐藏

 在菜单这里加了个鼠标移入移出功能,页面是这样

<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>home</title>
	<style>
		* {
			margin: 0;
			padding: 0;
			list-style: none;
		}

		html {
			width: 100%;
			height: 100%;
		}

		/* 头部--导航栏 */
		.home_top {
			width: 100%;
			height: 55px;
			position: absolute;
			background-color:  rgb(44, 120, 191);
		}

		.imgDiv {
			width: 250px;
			height: 55px;
			line-height: 55px;
			background-color: #fff;
		}

		.imgDiv img {
			width: 100%;
			height: 100%;
		}

		.totalButton {
			width: 55px;
			height: 55px;
			border-radius: 50%;
			position: relative;
			top: -55px;
			left: 250px;
			z-index: 100;
		}
		.totalButton img{
			width: 100%;
			height: 100%;
		}
		/* 中部内容区 */
		.home_foot{
			width: 100%;
			height: 91.6%;
			position: absolute;
			top:55px;
		}
		.box {
            position: absolute;
            width: 100%;
            height: 100%;
            overflow: hidden;
            display: flex;
        }
        .left {
            width: 20%;
            height: 100%;
            flex: 1;
            overflow: hidden;
            background-color: pink;
        }
        .line {
            width: 10px;
            background: lightblue;
            cursor: col-resize;
        }

        .line a {
            position: absolute;
			top: 44%;
			display: block;
			cursor: pointer;
			width: 10px;
			height: 100px;
			line-height: 100px;
			text-align: center;
			color: white;
			background-color: #666;
        }
		.right {
			position: relative;
			width: 80%;
			overflow: hidden;
		}

		.right div {
			position: absolute;
			width: 100%;
		}

		.top {
			background: green;
			height: 100%;
			overflow: hidden;
		}
		.bottom {
			height: 100%;
			overflow: hidden;
			background: yellow;
			top: 60%;
			margin-top: 10px;
		}

		.line_2 {
			top: 60%;
			height: 10px;
			overflow: hidden;
			background: lightblue;
			cursor: row-resize;
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.line_2 span{
			display: block;
			height: 10px;
			width: 10px;
		}
		.line1_2, .line1_3{
			cursor: pointer;
			display: block;
			width: 100px;
			height: 10px;
			line-height: 10px;
			text-align: center;
			color: white;
			background-color: #666;
		}
		/* 菜单选项 --------------------------------------------------------------------------------- */
		.meue {
			position: absolute;
			top: 50px;
			left: 20px;
			width: 870px;
			height: 420px;
			z-index: 100;
			display: none;
		}

		.meue_top {
			width: 100%;
			height: 30px;
		}

		.meue_top ul {
			width: 100%;
		}

		.meue_
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值