当前位置:   article > 正文

JS特效第136弹:响应式网页商品点击添加购物车

JS特效第136弹:响应式网页商品点击添加购物车

         JQuery+HTML5加入购物车代码,支持累加计价、响应式网页,先来看看效果:

        一部分关键的代码如下:

  1. <!DOCTYPE html>
  2. <html lang="en" class="no-js">
  3. <head lang="en">
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  7. <title>jQuery漂亮的响应式网页商品点击添加购物车代码</title>
  8. <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
  9. <link href="http://www.jq22.com/jquery/font-awesome.4.6.0.css" rel="stylesheet" media="screen">
  10. <link rel="stylesheet" type="text/css" href="css/style.css">
  11. </head>
  12. <body>
  13. <div class="ct-pageWrapper">
  14. <main>
  15. <div class="container">
  16. <div class="row">
  17. <div class="col-md-3">
  18. <div class="widget">
  19. <h2 class="widget-header">购物车</h2>
  20. <div class="ct-cart"></div>
  21. </div>
  22. </div>
  23. <div class="col-md-9">
  24. <div class="row">
  25. <div class="col-sm-4">
  26. <div class="ct-product">
  27. <div class="image"><img src="images/product-01.jpg" alt=""></div>
  28. <div class="inner"><a href="#" class="btn btn-motive ct-product-button"><i class="fa fa-shopping-cart"></i></a>
  29. <h2 class="ct-product-title">Box of macaroons</h2>
  30. <p class="ct-product-description">A very delicious macaroons ...</p><span class="ct-product-price">$19.99</span>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="col-sm-4">
  35. <div class="ct-product">
  36. <div class="image"><img src="images/product-02.jpg" alt=""></div>
  37. <div class="inner"><a href="#" class="btn btn-motive ct-product-button"><i class="fa fa-shopping-cart"></i></a>
  38. <h2 class="ct-product-title">Cherry Straws</h2>
  39. <p class="ct-product-description">A very delicious macaroons ...</p><span class="ct-product-price">$34.99</span>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="col-sm-4">
  44. <div class="ct-product">
  45. <div class="image"><img src="images/product-03.jpg" alt=""></div>
  46. <div class="inner"><a href="#" class="btn btn-motive ct-product-button"><i class="fa fa-shopping-cart"></i></a>
  47. <h2 class="ct-product-title">Coffee Macaroons</h2>
  48. <p class="ct-product-description">A very delicious macaroons ...</p><span class="ct-product-price">$59.99</span>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="col-sm-4">
  53. <div class="ct-product">
  54. <div class="image"><img src="images/product-04.jpg" alt=""></div>
  55. <div class="inner"><a href="#" class="btn btn-motive ct-product-button"><i class="fa fa-shopping-cart"></i></a>
  56. <h2 class="ct-product-title">Finetti ones</h2>
  57. <p class="ct-product-description">A very delicious macaroons ...</p><span class="ct-product-price">$9.99</span>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="col-sm-4">
  62. <div class="ct-product">
  63. <div class="image"><img src="images/product-05.jpg" alt=""></div>
  64. <div class="inner"><a href="#" class="btn btn-motive ct-product-button"><i class="fa fa-shopping-cart"></i></a>
  65. <h2 class="ct-product-title">Minty duo</h2>
  66. <p class="ct-product-description">A very delicious macaroons ...</p><span class="ct-product-price">$3.99</span>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="col-sm-4">
  71. <div class="ct-product">
  72. <div class="image"><img src="images/product-06.jpg" alt=""></div>
  73. <div class="inner"><a href="#" class="btn btn-motive ct-product-button"><i class="fa fa-shopping-cart"></i></a>
  74. <h2 class="ct-product-title">Pistachio</h2>
  75. <p class="ct-product-description">A very delicious macaroons ...</p><span class="ct-product-price">$13.99</span>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </main>
  84. <script src="js/jquery-1.11.3.min.js"></script>
  85. <script src="js/shop.min.js"></script>
  86. <script>
  87. $('body').ctshop({
  88. currency: '$',
  89. paypal: {
  90. currency_code: 'EUR'
  91. }
  92. });
  93. </script>
  94. </div>
  95. <div style="text-align:center;margin:-50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
  96. </div>
  97. </body>
  98. </html>

        全部代码:响应式网页商品点击添加购物车

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/90965
推荐阅读
相关标签
  

闽ICP备14008679号