网站首页> 源码> jQuery和css3超酷价格表3d旋转特效

jQuery和css3超酷价格表3d旋转特效

置顶 免费 4 1091
张世烩
张世烩 VIP3 2017-03-02
下载所需金币:0 收藏

简要教程

这是一款 超酷jQuery和css3价格表3d旋转特效插件。在插件中设计了3种不同样式的价格表,还集成了jQuery和css3弹性3d图片翻转分组展示特效用于将价格表从一面旋转到另一面。

在小屏幕上,我们使用另一种方案:将所有的价格表垂直排列,然后将价格表的内容水平排列,超出屏幕部分使用水平滚动条,这样,用户可以在同一个屏幕上比较3个表格的内容,利于用户体验。

HTML结构

html结构包含两个部分:div.cd-pricing-switcher包含用于过滤的按钮。ul.cd-pricing-list包含价格表。在.cd-pricing-list中的每一个列表项都嵌套一个二级的ul元素(用于旋转的那一面)。

<div class="cd-pricing-container">
  <div class="cd-pricing-switcher">
    <p class="fieldset">
      <input type="radio" name="duration" value="monthly" id="monthly" checked>
      <label for="monthly">Monthlylabel>
      <input type="radio" name="duration" value="yearly" id="yearly">
      <label for="yearly">Yearlylabel>
      <span class="cd-switch">span>
    p>
  div>
  
  <ul class="cd-pricing-list">
    <li>
      <ul class="cd-pricing-wrapper">
        <li data-type="monthly" class="is-visible">
          <header class="cd-pricing-header">
            <h2>Basich2>
            <div class="cd-price">
              <span class="cd-currency">$span>
              <span class="cd-value">30span>
              <span class="cd-duration">mospan>
            div>
          header>
  
          <div class="cd-pricing-body">
            <ul class="cd-pricing-features">
              <li><em>256MBem> Memoryli>
              
            ul>
          div>
  
          <footer class="cd-pricing-footer">
            <a class="cd-select" href="http://www.htmleaf.com/">Selecta>
          footer>
        li>
  
        <li data-type="yearly" class="is-hidden">
          
        li>
      ul>
    li>
  
    <li class="cd-popular">
      <ul class="cd-pricing-wrapper">
        <li data-type="monthly" class="is-visible">
          
        li>
  
        <li data-type="yearly" class="is-hidden">
          
        li>
      ul>
    li>
  
    <li>
      <ul class="cd-pricing-wrapper">
        <li data-type="monthly" class="is-visible">
          
        li>
  
        <li data-type="yearly" class="is-hidden">
          
        li>
      ul>
    li>
  ul>
div>

CSS样式

在小屏幕上,.cd-pricing-footer被设置为position: absolute,并将其放在.cd-pricing-header上。按钮被设置为display: blockheight: 100%,这样按钮有和表格底部相同高度的尺寸。并对 .cd-pricing-header使用 pointer-events: none来使按钮可点击。

.cd-pricing-header {
  height: 80px;
  pointer-events: none;
}
.cd-pricing-body {
  overflow-x: auto;
  /* smooth scrolling on touch devices */
  -webkit-overflow-scrolling: touch;
}
.cd-pricing-footer {
  position: absolute;
  top: 0;
  left: 0;
  height: 80px;
  width: 100%;
}
.cd-select {
  display: block;
  height: 100%;
  /* hide button text on mobile */
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  color: transparent;
}

在大屏幕上(屏幕尺寸大于1170px),CSS样式十分简单,你可以参照css文件上的注释。

重要提示:我们创建3个class来定制三个价格表(所有的class都被阴影到.cd-pricing-container 元素上)。

  • cd-full-width-为.cd-pricing-container元素设置100%宽度,max-width: none(默认情况下我们设置宽度为90%和max-width为1170px)。
  • cd-tables-have-margin-为价格表添加一个右边的margin。
  • cd-secondary-theme-用于实现不同的颜色theme。

在demo中我们创建了组价格表样式:第一组为默认的样式;第二组使用了.cd-full-width.cd-second-theme class;第三组使用了.cd-tables-have-margin class。


  • 没有任何评论
个评论
张世烩

张世烩 (白银)

1152金币 (29)粉丝 (96)源码

一切皆有可能!!!!

 

加入微信群,不定期分享源码和经验
签到活跃榜 连续签到送额外金币

所需金币:0

 赚金币方法:
  •   1. 注册就送5金币,发布源码,供别人下载赚取金币
  •   2. 发布博客,发布问答,回复其他用户赚取金币
  •   3. 自动充值或联系QQ1367251002客服人工充值
最新系统
springboot图书个性化推荐系统带文档 811
springboot的医护人员排班系统 809
基于SpringBoot的在线拍卖系统 786
学生选课系统+论文+数据库文件 1309
springboot+vue准妈妈孕期交流平台系统带论文 1869
springboot+vue汽车租赁系统带论文 1578
springboot社区维修平台带论文 1377
springboot职称评审管理系统带论文 1179
springboot牙科诊所管理系统带论文 1370
springboot家教管理系统带论文 1171