jquery侧边栏固定悬浮

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Welcome to nginx!</title>
<style>
.xuanfu{
	right: 0;
	position: fixed;
	bottom: 0;//底部边距
	width: 100%;//根据情况,可省
	z-index: 100;
	border-color:red;
}
</style></head>
<script
  src="http://code.jquery.com/jquery-3.3.1.js"
  integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
  crossorigin="anonymous">
</script>  
<body class="vsc-initialized">
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to

<p><em>Thank you for using nginx.</em></p>

<!--
<div class="xuanfu">
	<button type='button' class='fc-outline-dark winter-extend-br-siderright '>+</button>
	<button type='button' class='fc-outline-dark winter-curtail-br-siderright '>-</button>
</div>!
-->

<button class="reload-view" data-refresh-obj=".sideright" >
	加载侧边栏
</button>
<div class="sideright" style="right:0;position:fixed;width:280px;border:1px solid red;" hidden >

</div>
<script>
    $('body').on('click', '.reload-view', function (e) {
		var tag = $(this).data('refresh-obj');
		var obj = $(tag);
		if (tag == ".sideright") {
                        //obj.append("<div class='b--0 pos-fixed-force r--0 z-index-100'><button type = 'button' class= 'fc-outline-dark extend-br-siderright ' >+</button><button type='button' class='fc-outline-dark curtail-br-siderright '>-</button></div > ");
						//js添加扩宽与缩宽代码
						obj.append("<div class='xuanfu' style='border:1px solid red' ><button type = 'button' class= 'fc-outline-dark extend-br-siderright ' >+</button><button type='button' class='fc-outline-dark curtail-br-siderright '>-</button></div > ");
						
						
                    }
		obj.show();
	});
	// 侧边栏底部添加扩宽与缩宽
	$('body').on('click', '.extend-br-siderright', function (e) {
		e.preventDefault();
		$(".sideright").width("80%");
		$(".sideright").css({'border':'1px solid red'});
	});
	$('body').on('click', '.curtail-br-siderright', function (e) {
		e.preventDefault();
		$(".sideright").width("280px");
		$(".sideright").css({'border':'1px solid red'});
	});
</script>
</body>
</html>
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值