web前端之側滑 圖層掩蓋
阿新 • • 發佈:2018-12-27
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<base target="content" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<link rel="shortcut icon" href="favicon.ico">
<link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<style>
body{
margin: 0;
padding: 0;
overflow: hidden;
}
.page{
/*left: 300px;*/
/*border: 1px solid red;*/
position: absolute;
width: 100%;
height: 100%;
background-color: lavender;
}
.top{
position: fixed;
height: 60px;
width: 100%;
/*border: 1px solid black;*/
z-index: 500;
}
/*.top img{
height: 200px;
}*/
.mybtn{
font-size: 30px;
/*border: 1px solid red;*/
margin-top: 10px;
margin-left: 10px;
color: #FFFFFF;
}
.mybtn:hover{
cursor: pointer;
}
.backimg{
position: absolute;
width: 100%;
height: 100%;
z-index: 1000;
background-color: blanchedalmond ;
opacity: 0.3;
display: none;
}
.right-dr{
left: 300px;
position: absolute;
width: 300px;
height: 100%;
/*border: 1px solid red;*/
background-color: blanchedalmond;
z-index: -10;
}
.right-dr-tx{
text-align: center;
}
.right-dr-tx img{
display: block;
width: 100px;
border-radius: 50%;
margin: 50px 50px 0px 100px;
}
.right-dr-tx span{
margin: 0px 110px;
color: lightpink;
font-family: "微軟雅黑";
font-size: 30px;
}
.right-dr-tx i{
font-size: 15px;
color: pink;
}
.cont iframe{
position: absolute;
top: 65px;
width: 100%;
height: 100%;
border: 0px;
border: 0px solid black;
}
.dr-btn{
margin-top: 50px;
margin-left: 80px;
}
.dr-btn a{
display: block;
/*color: #FFFFFF;*/
text-decoration: none;
height: 60px;
text-indent: 20px;
line-height: 60px;
}
hr{
width: 200px;
color: red;
opacity: 0.3;
margin-top: 50px;
}
</style>
<script>
$(document).ready(function(){
//側滑按鈕點選事件
$(".mybtn").click(function(){
//頁面整體側滑
$(".page").animate({
left:'300px'
});
//顯示透明度
$(".backimg").css({
display:"block"
});
//左側導航右滑
$(".right-dr").animate({
left:'0px'
});
});
//還原點選事件
$(".backimg").click(function(){
//頁面整體左滑動
$(".page").animate({
left:'0px'
});
//顯示透明度
$(".backimg").css({
display:"none"
});
//左側導航右滑
$(".right-dr").animate({
left:'-300px'
});
});
//欄目選擇事件
$(".dr-btn a").click(function(){
//頁面整體左滑動
$(".page").animate({
left:'0px'
});
//顯示透明度div層隱藏
$(".backimg").css({
display:"none"
});
//左側導航右滑
$(".right-dr").animate({
left:'-300px'
});
});
});
</script>
</head>
<body>
<!--右側導航 -->
<div class="right-dr">
<!--右側導航頭像-->
<div class="right-dr-tx">
<img src="img/l04.jpg" /><br />
<span>劉雯</span>
<br />
<i class="fa fa-map-marker"> China</i>
</div>
<hr />
<div class="dr-btn">
<a href="grzl.html">
<i class="fa fa-bars"></i> 個人資料
</a>
<a href="zpzs.html">
<i class="fa fa-share-alt"></i> 作品展示
</a>
<a href="ysxz.html">
<i class="fa fa-image"></i> 藝術寫真
</a>
<a href="yyjl.html">
<i class="fa fa-envelope-o"></i> 演藝經歷
</a>
</div>
</div>
<!--左側介面-->
<div class="page">
<div class="backimg"></div>
<div class="top">
<!--<img src="img/l015.jpeg" />-->
<!--向右滑動-->
<i class="mybtn fa fa-user" ></i>
</div>
<!--主要內容-->
<div class="cont">
<iframe name="content" src="fristl.html"></iframe>
</div>
</div>
</body>
</html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<base target="content" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<link rel="shortcut icon" href="favicon.ico">
<link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<style>
body{
margin: 0;
padding: 0;
overflow: hidden;
}
.page{
/*left: 300px;*/
/*border: 1px solid red;*/
position: absolute;
width: 100%;
height: 100%;
background-color: lavender;
}
.top{
position: fixed;
height: 60px;
width: 100%;
/*border: 1px solid black;*/
z-index: 500;
}
/*.top img{
height: 200px;
}*/
.mybtn{
font-size: 30px;
/*border: 1px solid red;*/
margin-top: 10px;
margin-left: 10px;
color: #FFFFFF;
}
.mybtn:hover{
cursor: pointer;
}
.backimg{
position: absolute;
width: 100%;
height: 100%;
z-index: 1000;
background-color: blanchedalmond ;
opacity: 0.3;
display: none;
}
.right-dr{
left: 300px;
position: absolute;
width: 300px;
height: 100%;
/*border: 1px solid red;*/
background-color: blanchedalmond;
z-index: -10;
}
.right-dr-tx{
text-align: center;
}
.right-dr-tx img{
display: block;
width: 100px;
border-radius: 50%;
margin: 50px 50px 0px 100px;
}
.right-dr-tx span{
margin: 0px 110px;
color: lightpink;
font-family: "微軟雅黑";
font-size: 30px;
}
.right-dr-tx i{
font-size: 15px;
color: pink;
}
.cont iframe{
position: absolute;
top: 65px;
width: 100%;
height: 100%;
border: 0px;
border: 0px solid black;
}
.dr-btn{
margin-top: 50px;
margin-left: 80px;
}
.dr-btn a{
display: block;
/*color: #FFFFFF;*/
text-decoration: none;
height: 60px;
text-indent: 20px;
line-height: 60px;
}
hr{
width: 200px;
color: red;
opacity: 0.3;
margin-top: 50px;
}
</style>
<script>
$(document).ready(function(){
//側滑按鈕點選事件
$(".mybtn").click(function(){
//頁面整體側滑
$(".page").animate({
left:'300px'
});
//顯示透明度
$(".backimg").css({
display:"block"
});
//左側導航右滑
$(".right-dr").animate({
left:'0px'
});
});
//還原點選事件
$(".backimg").click(function(){
//頁面整體左滑動
$(".page").animate({
left:'0px'
});
//顯示透明度
$(".backimg").css({
display:"none"
});
//左側導航右滑
$(".right-dr").animate({
left:'-300px'
});
});
//欄目選擇事件
$(".dr-btn a").click(function(){
//頁面整體左滑動
$(".page").animate({
left:'0px'
});
//顯示透明度div層隱藏
$(".backimg").css({
display:"none"
});
//左側導航右滑
$(".right-dr").animate({
left:'-300px'
});
});
});
</script>
</head>
<body>
<!--右側導航 -->
<div class="right-dr">
<!--右側導航頭像-->
<div class="right-dr-tx">
<img src="img/l04.jpg" /><br />
<span>劉雯</span>
<br />
<i class="fa fa-map-marker"> China</i>
</div>
<hr />
<div class="dr-btn">
<a href="grzl.html">
<i class="fa fa-bars"></i> 個人資料
</a>
<a href="zpzs.html">
<i class="fa fa-share-alt"></i> 作品展示
</a>
<a href="ysxz.html">
<i class="fa fa-image"></i> 藝術寫真
</a>
<a href="yyjl.html">
<i class="fa fa-envelope-o"></i> 演藝經歷
</a>
</div>
</div>
<!--左側介面-->
<div class="page">
<div class="backimg"></div>
<div class="top">
<!--<img src="img/l015.jpeg" />-->
<!--向右滑動-->
<i class="mybtn fa fa-user" ></i>
</div>
<!--主要內容-->
<div class="cont">
<iframe name="content" src="fristl.html"></iframe>
</div>
</div>
</body>
</html>