jSlider简洁的幻灯片自适应全屏宽度
XML/HTML Code
- <div class="jSlider" id="slider1" data-loop="true">
- <div><img src="../788/images/photo1.jpg" alt="sample photo">
- </div>
- <div><img src="../788/images/photo2.jpg" alt="sample photo">
- <div class="sub-content-sample">
- <p>各种下拉菜单,导航,多级菜单,右侧展开,左侧展开</p>
- </div>
- </div>
- <div><img src="../788/images/photo3.jpg" alt="sample photo">
- </div>
- </div>
CSS Code
- <style type="text/css">
- #slider1 {
- width: 100%;
- max-height: 700px;
- margin-bottom: 75px;
- }
- .sub-content-sample {
- font-size: 30px;
- line-height: 1.25;
- padding: 20px 40px;
- width: 50%;
- min-width: 200px;
- max-width: 500px;
- color: #fff;
- background: #000;
- background: rgba(0, 0, 0, 0.5);
- position: absolute;
- top: 20px;
- rightright: 20px;
- }
- .sub-content-sample p {
- margin: 0;
- padding: 0;
- }
- .sub-content-sample a {
- color: #fff;
- font-weight: bold;
- }
- /* responsive rules */
- @media (max-width: 1199px) {
- .sub-content-sample {
- font-size: 20px;
- }
- }
- @media (max-width: 991px) {
- }
- @media (max-width: 767px) {
- .sub-content-sample {
- font-size: 12px;
- padding: 10px;
- }
- }
- @media (max-width: 480px) {
- .sub-content-sample {
- font-size: 10px;
- }
- }
- @media (max-width: 384px) {
- .sub-content-sample {
- font-size: 10px;
- }
- }
- </style>
原文地址:http://www.freejs.net/article_jiaodiantu_789.html