图片/图形

jQuery+CSS3卡片列表布局特效

阿里云


这是一款 jQuery 和 CSS3 卡片列表布局特效。该卡片布局使用 owl.carousel.js 来制作轮播效果,使用简单的 css 代码来制作卡片布局,整体效果时尚大方。

使用方法

在页面最后引入 jquery 和 owl.carousel.js 相关文件。

也想出现在这里?联系我们
创客主机
  1. <link rel="stylesheet" type="text/css" href="css/bootstrap-grid.min.css" />
  2. <link rel="stylesheet" href="owl-carousel/1.3.3/owl.carousel.min.css"/>
  3. <script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
  4. <script type="text/javascript" src="owl-carousel/1.3.3/owl.carousel.min.js"></script>

HTML 结构

该卡片布局的 HTML 结果如下。

  1. <div class="container">
  2.     <div class="row">
  3.         <div class="col-md-12">
  4.             <div id="news-slider" class="owl-carousel">
  5.                 <div class="post-slide">
  6.                     <div class="post-header">
  7.                         <a href="#" class="subtitle">Lorem ipsum</a>
  8.                         <h3 class="post-title"><a href="#">Latest News Post</a></h3>
  9.                     </div>
  10.                     <div class="pic">
  11.                         <img src="images/img-1.jpg" alt="">
  12.                     </div>
  13.                     <ul class="post-bar">
  14.                         <li><i class="fa fa-users"></i> <a href="#">Admin</a></li>
  15.                         <li><i class="fa fa-clock-o"></i> March 5,2016</li>
  16.                         <li><i class="fa fa-comments"></i> <a href="#">2 Comment</a></li>
  17.                     </ul>
  18.                     <p class="post-description">
  19.                         Lorem ipsum dolor sit amet, 
  20.                     </p>
  21.                     <a href="#" class="read-more">read more</a>
  22.                 </div>
  23.  
  24.                 <div class="post-slide">
  25.                     <div class="post-header">
  26.                         <a href="#" class="subtitle">Lorem ipsum</a>
  27.                         <h3 class="post-title"><a href="#">Latest News Post</a></h3>
  28.                     </div>
  29.                     <div class="pic">
  30.                         <img src="images/img-2.jpg" alt="">
  31.                     </div>
  32.                     <ul class="post-bar">
  33.                         <li><i class="fa fa-users"></i> <a href="#">Admin</a></li>
  34.                         <li><i class="fa fa-clock-o"></i> March 7,2016</li>
  35.                         <li><i class="fa fa-comments"></i> <a href="#">3 Comment</a></li>
  36.                     </ul>
  37.                     <p class="post-description">
  38.                         Lorem ipsum dolor sit amet,
  39.                     </p>
  40.                     <a href="#" class="read-more">read more</a>
  41.                 </div>
  42.             </div>
  43.         </div>
  44.     </div>
  45. </div>

CSS 样式

然后添加下面的 CSS 样式。

  1. .post-slide{
  2.     background: #fff;
  3.     margin: 0 15px;
  4.     padding:27px 30px;
  5.     border-bottom: 1px solid #dedde1;
  6. }
  7. .post-slide .post-header{
  8.     margin-bottom: 10px;
  9. }
  10. .post-slide .subtitle{
  11.     color:#0b99bc;
  12.     font-size:14px;
  13.     display: inline-block;
  14.     margin-bottom:5px;
  15.     text-transform: uppercase;
  16.     transition: all 0.4s ease 0s;
  17. }
  18. .post-slide .subtitle:hover{
  19.     color:#333;
  20.     text-decoration: none;
  21. }
  22. .post-slide .post-title{
  23.     margin: 0;
  24. }
  25. .post-slide .post-title a{
  26.     color:#333;
  27.     font-size:18px;
  28.     font-weight: bold;
  29.     text-transform:capitalize;
  30.     transition: all 0.4s ease 0s;
  31. }
  32. .post-slide .post-title a:hover{
  33.     color:#0b99bc;
  34.     text-decoration: none;
  35. }
  36. .post-slide .pic{
  37.     overflow: hidden;
  38.     position: relative;
  39. }
  40. .post-slide .pic img{
  41.     width: 100%;
  42.     height: auto;
  43.     transform: rotate(0deg) scale(1,1);
  44.     transition: all 0.9s ease 0s;
  45. }
  46. .post-slide:hover img{
  47.     transform: rotate(-2deg) scale(1.1,1.1);
  48. }
  49. .post-slide .pic:after{
  50.     content: "";
  51.     position: absolute;
  52.     top:0;
  53.     left:0;
  54.     width: 100%;
  55.     height: 100%;
  56.     background: rgba(255,255,255,0);
  57.     transition: all 0.9s ease 0s;
  58.  
  59. }
  60. .post-slide:hover .pic:after{
  61.     background: rgba(255,255,255,0.2);
  62. }
  63. .post-slide .post-bar{
  64.     list-style: none;
  65.     padding:12px 0;
  66.     margin: 0;
  67. }
  68. .post-slide .post-bar li{
  69.     display: inline-block;
  70.     margin-right:3px;
  71.     color:#aaa;
  72. }
  73. .post-slide .post-bar li:last-child{
  74.     margin-right: 0;
  75. }
  76. .post-slide .post-bar li a{
  77.     color:#aaa;
  78.     transition:0.3s ease;
  79. }
  80. .post-slide .post-bar li a:hover{
  81.     text-decoration: none;
  82.     color:#0b99bc;
  83. }
  84. .post-slide .post-description{
  85.     font-size: 14px;
  86.     line-height: 24px;
  87.     margin-bottom:15px;
  88.     color:#767676;
  89. }
  90. .post-slide .read-more{
  91.     color:#0b99bc;
  92.     font-size: 14px;
  93.     font-style: italic;
  94.     text-transform: capitalize;
  95. }
  96. .post-slide .read-more:hover{
  97.     color:#333;
  98.     text-decoration:none;
  99. }
  100. @media only screen and (max-width: 479px) {
  101.     .post-slide{
  102.         padding: 15px;
  103.     }
  104.     .post-slide .post-bar li{
  105.         margin-bottom: 5px;
  106.     }
  107.     .post-slide .post-bar li:last-child{
  108.         margin-bottom: 0;
  109.     }
  110. }

初始化插件

最后通过下面的代码来初始化 owl.carousel.js 插件。

  1. $(document).ready(function() {
  2.     $("#news-slider").owlCarousel({
  3.         items : 3,
  4.         itemsDesktop:[1199,3],
  5.         itemsDesktopSmall:[1000,2],
  6.         itemsMobile : [650,1],
  7.         navigationText:false,
  8.         autoPlay:true
  9.     });
  10. });

jQuery+CSS3 卡片列表布局特效

已有 446 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!