康諾科技java培訓小課堂:Web前端——橫向切換屏幕
康諾科技java培訓小課堂:Web前端——橫向切換屏幕
用到的知識點:html+css+js。
實現的效果:橫向切換屏幕
源碼:
橫向滾屏效果
第一屏
第二屏
第三屏
第四屏
第一屏
第二屏
第三屏
第四屏
//滑鼠滑動觸發或手機觸屏觸摸橫屏滾動效果
$("section").horizon();
style.css源碼:html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
section, header,footer, nav, div, span, ul, li, a {
box-sizing: border-box;
}
header {
position: fixed;
top: 0;
right: 0;
left: 0;
background-color: #f2f2f2;
}
header nav {
}
header ul {
margin: 0;
padding: 0;
list-style: none;
}
header ul li {
display: inline-block;
padding: 0 20px;
}
header ul a {
text-decoration: none;
color: #4d4d4d;
height: 50px;
display: block;
position: relative;
}
header ul a span{
position: relative;
top: 50%;
transform: translateY(-50%);
display: inline-block;
}
section {
float: left;
display: block;
height: 100%;
padding: 75px 0 0 0;
margin: 0;
}
#section-section1{
background: #2c3e50;
}
#section-section2{
background: #16a085;
}
#section-section3{
background: #27ae60;
}
#section-section4{
background: #c0392b;
}
.horizon-prev,.horizon-next {
position: fixed;
top: 50%;
margin-top: -24px;
z-index: 9999;
}
.horizon-prev {
left: 20px;
}
.horizon-next {
right: 20px;
}
文/康諾科技
TAG:康諾科技 |
※開學第一課:ray(anjeri)課堂
※imToken 小課堂開課啦
※Class Report 課堂反饋
※Shelly的護膚課堂
※Dysonhair戴森頭髮課堂
※朱老師信息技術課堂のPhotoshop一網打盡!
※安仔課堂:滲透測試神器Cobalt Strike使用寶典!
※索尼發力教育領域 Vision Exchange讓課堂真的「動」起來
※學在美本Study@American Colleges—大課堂篇
※『妄想課堂』Jack the Ripper
※Chantelle護膚課堂如何敷面膜
※Swei英語小課堂「give cold shoulder」你需要一個「冷肩膀」嗎?
※爐石英語小課堂第15期 「battlecry」 戰吼屬性
※微軟公司收購課堂協作平台Chalkup,後者將整合入Microsoft Team教育產品中
※蘋果正式推出Schoolwork 課堂生態搭建完成
※Chef Lee牛排小課堂——入門級
※爐石英語小課堂第9期 「greetings」 花式打招呼
※爐石英語小課堂第6期 「legendary」哇 金色傳說
※Apple使用ClassKit教育框架,為教師,學生和管理員提供了更多的課堂力量
※Swei英語小課堂「add fuel to the fire」沒錯就是火上澆油