{"id":4228,"date":"2019-11-18T16:21:50","date_gmt":"2019-11-18T16:21:50","guid":{"rendered":"https:\/\/webdevtrick.com\/?p=4228"},"modified":"2019-11-20T10:24:28","modified_gmt":"2019-11-20T10:24:28","slug":"bootstrap-expand-cards","status":"publish","type":"post","link":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/","title":{"rendered":"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card"},"content":{"rendered":"<p><strong>How we can create expanding collapsible card using Bootstrap CSS JS? Solution: See this Bootstrap Expand Cards Animation With CSS, Bootstrap Collapsible Card.<\/strong><\/p>\n<p>Previously I have shared some <span><a href=\"https:\/\/webdevtrick.com\/tag\/card\/\" target=\"_blank\" rel=\"noopener noreferrer\">card programs<\/a><\/span>, but this is an<strong> expandable card<\/strong> with <strong>collapse animation<\/strong>. Basically, this type of card majorly used in the backend site of websites because it takes less place and easy to manage. The card opens on when you want, after that it takes space on the webpage.<\/p>\n<p>Today you will learn to create <strong>Collapsible Card<\/strong> using <strong>Bootstrap<\/strong>. Basically there are <strong>6 cards<\/strong> with dummy inner items, when you will click on that it will <strong>expand<\/strong> in the downside. The card contains a title and a <span><a href=\"https:\/\/webdevtrick.com\/generate-random-numbers-in-php\/\" target=\"_blank\" rel=\"noopener noreferrer\">number<\/a><\/span> for showing some data about the inner section, and when you will click on it then some<strong> sub-items will reveal<\/strong>. Also, these cards have <strong>collapsible animation<\/strong> on expanding and hide.<\/p>\n<p>So, Today I am sharing <strong>Bootstrap Expand Cards<\/strong> Animation With <strong>CSS<\/strong>. There I have used <strong>Bootstrap<\/strong> for creating the layout and some functions, and JS handling important features also CSS has an important role.\u00a0 This type of <strong>card<\/strong> you can use on your website for showing more <strong>information<\/strong> in less space.<\/p>\n<p>If you are thinking now how this expand cards actually are, then see the preview given below.<\/p>\n<h3>Preview Of Collapsible Card<\/h3>\n<p>See this video preview to getting an idea of how these cards look like.<\/p>\n<div style=\"width: 640px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-4228-1\" width=\"640\" height=\"280\" loop autoplay preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/webdevtrick.com\/wp-content\/uploads\/expanding-cards.mp4?_=1\" \/><a href=\"https:\/\/webdevtrick.com\/wp-content\/uploads\/expanding-cards.mp4\">https:\/\/webdevtrick.com\/wp-content\/uploads\/expanding-cards.mp4<\/a><\/video><\/div>\n<a class=\"maxbutton-2 maxbutton maxbutton-demo\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/webdevtrick.com\/demos\/bootstrap-expand-cards\/\"><span class='mb-text'>Live Demo<\/span><\/a>\n<p>Now you can see this visually, also you can see it live by pressing the button given above. If you like this then get the <strong>source code<\/strong> of its.<\/p>\n<p><span style=\"font-size: 14pt;\">You May Also Like:<\/span><\/p>\n<ul>\n \t<span><\/p>\n<li><a href=\"https:\/\/webdevtrick.com\/javascript-css-ripple-effect\/\" target=\"_blank\" rel=\"noopener noreferrer\">JavaScript CSS Ripple Effect<\/a><\/li>\n<li><a href=\"https:\/\/webdevtrick.com\/javascript-instagram-media-downloader\/\" target=\"_blank\" rel=\"noopener noreferrer\">Instagram Media Downloader<\/a><\/li>\n<li><a href=\"https:\/\/webdevtrick.com\/html-contact-form\/\" target=\"_blank\" rel=\"noopener noreferrer\">Responsive Contact Us Form<\/a><\/li>\n<li><a href=\"https:\/\/webdevtrick.com\/html-css-javascript-sticky-navbar\/\" target=\"_blank\" rel=\"noopener noreferrer\">Sticky Navigation Bar<\/a><\/li>\n<p><\/span>\n<\/ul>\n<h2>Bootstrap Expand Cards Animation With CSS Source Code<\/h2>\n<p>Before <strong>sharing source code<\/strong>, let&#8217;s talk about it. First I have created the layout using bootstrap&#8217;s <strong>grid<\/strong> system (<a href=\"https:\/\/getbootstrap.com\/docs\/4.1\/layout\/grid\/\" target=\"_blank\" rel=\"noopener noreferrer\">info<\/a>). And I have created the first card then I have copied and paste for creating others, later I made some changes in <strong>all cards<\/strong>. Inside the all cards section I have put the same class or ID names. Also In the <strong>HTML file<\/strong>, I have linked other files like CSS, JS, and Bootstrap CDN link.<\/p>\n<p>Now <strong>using CSS<\/strong> I have styled all the items as you can see in the preview. With CSS I have done styling works like margin, padding, size, <span><a href=\"https:\/\/webdevtrick.com\/tag\/css-animation\" target=\"_blank\" rel=\"noopener noreferrer\">animation<\/a><\/span>, etc. For creating the <strong>collapsible feature<\/strong> I have used CSS <span class=\"lang:default decode:true crayon-inline \">transform<\/span> command, and some other works had done like color using CSS. I have reduced some element&#8217;s size and change the <strong>grid system<\/strong> using CSS <strong>@media<\/strong> query.<\/p>\n<p>Basically, JavaScript handling the <span><a href=\"https:\/\/webdevtrick.com\/tag\/toggle-switch\/\" target=\"_blank\" rel=\"noopener noreferrer\">toggle feature<\/a><\/span> of the program. There I have used <strong>jQuery<\/strong> for easy work and save times, and as we know jQuery is a JS library that&#8217;s why I am calling this <strong>JavaScript program<\/strong>. For creating the <strong>open and close card<\/strong> function I have used JS <span class=\"lang:default decode:true crayon-inline \">if {} else {}<\/span> statement to declare conditions.<\/p>\n<p>Left all other things you will understand after <strong>getting the codes<\/strong>, I can&#8217;t explain all in writing. For creating this program you have to create 3 files. First for <strong>HTML<\/strong>, second for <strong>CSS<\/strong>, and the third for <strong>JavaScript<\/strong>. Follow the steps to creating this program without any error.<\/p>\n<p><span style=\"font-size: 14pt;\">index.html<\/span><\/p>\n<p>Create an HTML file named &#8216;<em><strong>index.html<\/strong><\/em>&#8216; and put these codes given below.<\/p>\n<pre class=\"height-set:true height:750 lang:xhtml decode:true \" title=\"index.html\">&lt;!DOCTYPE html&gt;\r\n&lt;!-- Code By Webdevtrick (https:\/\/webdevtrick.com) --&gt;\r\n&lt;html lang=\"en\" &gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"UTF-8\"&gt;\r\n  &lt;title&gt;Bootstrap Expand Cards | Webdevtrick.com&lt;\/title&gt;\r\n  &lt;link rel='stylesheet' href='https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.3.7\/css\/bootstrap.min.css'&gt;\r\n  &lt;link rel=\"stylesheet\" href=\"style.css\"&gt;\r\n\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;div class='row dashboard-cards'&gt;\r\n  &lt;div class='card col-md-4 '&gt;\r\n    &lt;div class='card-title'&gt;\r\n      &lt;h2&gt;\r\n        First Task\r\n        &lt;small&gt;You have 14 pending tasks&lt;\/small&gt;\r\n      &lt;\/h2&gt;\r\n      &lt;div class='task-count'&gt;\r\n        14\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class='card-flap flap1'&gt;\r\n      &lt;div class='card-description'&gt;\r\n        &lt;ul class='task-list'&gt;\r\n          &lt;li&gt;\r\n            1st Inner Section Task\r\n            &lt;span&gt;59%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            2nd Inner Section Task\r\n            &lt;span&gt;11%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            3rd Inner Section Task\r\n            &lt;span&gt;100%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            4th Inner Section Task\r\n            &lt;span&gt;7%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n        &lt;\/ul&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div class='card-flap flap2'&gt;\r\n        &lt;div class='card-actions'&gt;\r\n          &lt;a class='btn' href='#'&gt;Close&lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class='card col-md-4 '&gt;\r\n    &lt;div class='card-title'&gt;\r\n      &lt;h2&gt;\r\n        Second Task\r\n        &lt;small&gt;You have 62 pending tasks&lt;\/small&gt;\r\n      &lt;\/h2&gt;\r\n      &lt;div class='task-count'&gt;\r\n        62\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class='card-flap flap1'&gt;\r\n      &lt;div class='card-description'&gt;\r\n        &lt;ul class='task-list'&gt;\r\n          &lt;li&gt;\r\n            1st Inner Section Task\r\n            &lt;span&gt;59%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            2nd Inner Section Task\r\n            &lt;span&gt;11%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            3rd Inner Section Task\r\n            &lt;span&gt;100%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            4th Inner Section Task\r\n            &lt;span&gt;7%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n        &lt;\/ul&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div class='card-flap flap2'&gt;\r\n        &lt;div class='card-actions'&gt;\r\n          &lt;a class='btn' href='#'&gt;Close&lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class='card col-md-4 '&gt;\r\n    &lt;div class='card-title'&gt;\r\n      &lt;h2&gt;\r\n        Third Task\r\n        &lt;small&gt;You have 9 pending tasks&lt;\/small&gt;\r\n      &lt;\/h2&gt;\r\n      &lt;div class='task-count'&gt;\r\n        9\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class='card-flap flap1'&gt;\r\n      &lt;div class='card-description'&gt;\r\n        &lt;ul class='task-list'&gt;\r\n          &lt;li&gt;\r\n            1st Inner Section Task\r\n            &lt;span&gt;59%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            2nd Inner Section Task\r\n            &lt;span&gt;11%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            3rd Inner Section Task\r\n            &lt;span&gt;100%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            4th Inner Section Task\r\n            &lt;span&gt;7%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n        &lt;\/ul&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div class='card-flap flap2'&gt;\r\n        &lt;div class='card-actions'&gt;\r\n          &lt;a class='btn' href='#'&gt;Close&lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class='card col-md-4 '&gt;\r\n    &lt;div class='card-title'&gt;\r\n      &lt;h2&gt;\r\n        Fourth Task\r\n        &lt;small&gt;You have 56 pending tasks&lt;\/small&gt;\r\n      &lt;\/h2&gt;\r\n      &lt;div class='task-count'&gt;\r\n        56\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class='card-flap flap1'&gt;\r\n      &lt;div class='card-description'&gt;\r\n        &lt;ul class='task-list'&gt;\r\n          &lt;li&gt;\r\n            1st Inner Section Task\r\n            &lt;span&gt;59%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            2nd Inner Section Task\r\n            &lt;span&gt;11%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            3rd Inner Section Task\r\n            &lt;span&gt;100%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            4th Inner Section Task\r\n            &lt;span&gt;7%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n        &lt;\/ul&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div class='card-flap flap2'&gt;\r\n        &lt;div class='card-actions'&gt;\r\n          &lt;a class='btn' href='#'&gt;Close&lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class='card col-md-4 '&gt;\r\n    &lt;div class='card-title'&gt;\r\n      &lt;h2&gt;\r\n        Fifth Task\r\n        &lt;small&gt;You have 12 pending tasks&lt;\/small&gt;\r\n      &lt;\/h2&gt;\r\n      &lt;div class='task-count'&gt;\r\n        12\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class='card-flap flap1'&gt;\r\n      &lt;div class='card-description'&gt;\r\n        &lt;ul class='task-list'&gt;\r\n          &lt;li&gt;\r\n            1st Inner Section Task\r\n            &lt;span&gt;59%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            2nd Inner Section Task\r\n            &lt;span&gt;11%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            3rd Inner Section Task\r\n            &lt;span&gt;100%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            4th Inner Section Task\r\n            &lt;span&gt;7%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n        &lt;\/ul&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div class='card-flap flap2'&gt;\r\n        &lt;div class='card-actions'&gt;\r\n          &lt;a class='btn' href='#'&gt;Close&lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class='card col-md-4 '&gt;\r\n    &lt;div class='card-title'&gt;\r\n      &lt;h2&gt;\r\n        Sixth Task\r\n        &lt;small&gt;You have 24 pending tasks&lt;\/small&gt;\r\n      &lt;\/h2&gt;\r\n      &lt;div class='task-count'&gt;\r\n        24\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class='card-flap flap1'&gt;\r\n      &lt;div class='card-description'&gt;\r\n        &lt;ul class='task-list'&gt;\r\n          &lt;li&gt;\r\n            1st Inner Section Task\r\n            &lt;span&gt;59%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            2nd Inner Section Task\r\n            &lt;span&gt;11%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            3rd Inner Section Task\r\n            &lt;span&gt;100%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;\r\n            4th Inner Section Task\r\n            &lt;span&gt;7%&lt;\/span&gt;\r\n          &lt;\/li&gt;\r\n        &lt;\/ul&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div class='card-flap flap2'&gt;\r\n        &lt;div class='card-actions'&gt;\r\n          &lt;a class='btn' href='#'&gt;Close&lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n\r\n&lt;script src='https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/3.1.1\/jquery.min.js'&gt;\r\n&lt;\/script&gt;&lt;script  src=\"function.js\"&gt;&lt;\/script&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p><span style=\"font-size: 14pt;\">style.css<\/span><\/p>\n<p>Now create a CSS file named &#8216;<em><strong>style.css<\/strong><\/em>&#8216; and put these codes given here.<\/p>\n<pre class=\"height-set:true height:750 lang:css decode:true \" title=\"style.css\">\/* Code By Webdevtrick (https:\/\/webdevtrick.com) *\/\r\nbody {\r\n  background: #f3f3f3;\r\n  padding: 30px 20px;\r\n}\r\n\r\n.dashboard-cards {\r\n  position: relative;\r\n  padding-bottom: 50px;\r\n  margin: 0 !important;\r\n}\r\n\r\n.dashboard-cards .card {\r\n  background: #ffffff;\r\n  display: inline-block;\r\n  -webkit-perspective: 1000;\r\n  perspective: 1000;\r\n  z-index: 20;\r\n  padding: 0 !important;\r\n  margin: 5px 5px 10px 5px;\r\n  position: relative;\r\n  text-align: left;\r\n  transition: all 0.3s 0s ease-in;\r\n  z-index: 1;\r\n  width: calc(33.33333333% - 10px);\r\n  cursor: pointer;\r\n  transition: all 0.3s ease;\r\n}\r\n\r\n.dashboard-cards .card:hover {\r\n  box-shadow: 0 15px 10px -10px rgba(31, 31, 31, 0.5);\r\n  transition: all 0.3s ease;\r\n}\r\n\r\n.dashboard-cards .card .card-title {\r\n  background: #ffffff;\r\n  padding: 20px 15px;\r\n  position: relative;\r\n  z-index: 0;\r\n}\r\n\r\n.dashboard-cards .card .card-title h2 {\r\n  font-size: 24px;\r\n  letter-spacing: -0.05em;\r\n  margin: 0;\r\n  padding: 0;\r\n}\r\n\r\n.dashboard-cards .card .card-title h2 small {\r\n  display: block;\r\n  font-size: 14px;\r\n  margin-top: 8px;\r\n  letter-spacing: -0.025em;\r\n}\r\n\r\n.dashboard-cards .card .card-description {\r\n  position: relative;\r\n  font-size: 14px;\r\n  border-top: 1px solid #ddd;\r\n  padding: 10px 15px 0 15px;\r\n}\r\n\r\n.dashboard-cards .card .card-actions {\r\n  box-shadow: 0 2px 0px 0 rgba(0, 0, 0, 0.075);\r\n  padding: 10px;\r\n  text-align: center;\r\n}\r\n\r\n.dashboard-cards .card .card-flap {\r\n  background: #d9d9d9;\r\n  position: absolute;\r\n  width: 100%;\r\n  -webkit-transform-origin: top;\r\n  transform-origin: top;\r\n  -webkit-transform: rotateX(-90deg);\r\n  transform: rotateX(-90deg);\r\n}\r\n\r\n.dashboard-cards .card .flap1 {\r\n  transition: all 0.3s 0.3s ease-out;\r\n  z-index: -1;\r\n}\r\n\r\n.dashboard-cards .card .flap2 {\r\n  transition: all 0.3s 0s ease-out;\r\n  z-index: -2;\r\n}\r\n\r\n.dashboard-cards.showing .card {\r\n  cursor: pointer;\r\n  opacity: 0.6;\r\n  -webkit-transform: scale(0.88);\r\n  transform: scale(0.88);\r\n}\r\n\r\n.dashboard-cards .no-touch .dashboard-cards.showing .card:hover {\r\n  opacity: 0.94;\r\n  -webkit-transform: scale(0.92);\r\n  transform: scale(0.92);\r\n}\r\n\r\n.dashboard-cards .card.d-card-show {\r\n  opacity: 1 !important;\r\n  -webkit-transform: scale(1) !important;\r\n  transform: scale(1) !important;\r\n}\r\n\r\n.dashboard-cards .card.d-card-show .card-flap {\r\n  background: #ffffff;\r\n  -webkit-transform: rotateX(0deg);\r\n  transform: rotateX(0deg);\r\n}\r\n\r\n.dashboard-cards .card.d-card-show .flap1 {\r\n  transition: all 0.3s 0s ease-out;\r\n}\r\n\r\n.dashboard-cards .card.d-card-show .flap2 {\r\n  transition: all 0.3s 0.2s ease-out;\r\n}\r\n\r\n.dashboard-cards .card .task-count {\r\n  width: 40px;\r\n  height: 40px;\r\n  position: absolute;\r\n  top: 22px;\r\n  right: 10px;\r\n  background: #ecf0f1;\r\n  text-align: center;\r\n  line-height: 40px;\r\n  border-radius: 100%;\r\n  color: #333333;\r\n  font-weight: 600;\r\n  transition: all .2s ease;\r\n}\r\n\r\n.dashboard-cards .task-list {\r\n  padding: 0 !important;\r\n}\r\n\r\n.dashboard-cards .task-list li {\r\n  padding: 10px 0;\r\n  padding-left: 10px;\r\n  margin: 3px 0;\r\n  list-style-type: none;\r\n  border-bottom: 1px solid #e9ebed;\r\n  border-left: 3px solid #ff3a3a;\r\n  transition: all .2s ease;\r\n}\r\n\r\n.dashboard-cards .task-list li:hover {\r\n  background: #ecf0f1;\r\n  transition: all .2s ease;\r\n}\r\n\r\n.dashboard-cards .task-list li span {\r\n  float: right;\r\n  color: #ff3a3a;\r\n  margin-right: 5px;\r\n}\r\n\r\n.dashboard-cards.showing .card.d-card-show .task-count {\r\n  color: #ffffff;\r\n  background: #ff3a3a;\r\n  transition: all .2s ease;\r\n}\r\n\r\n.dashboard-cards .card-actions .btn {\r\n  color: #333;\r\n}\r\n\r\n.dashboard-cards .card-actions .btn:hover {\r\n  color: #ff3a3a;\r\n}\r\n@media (max-width:750px) {\r\n  .dashboard-cards .card {\r\n    margin-top: 10px;\r\n    width: 100%;\r\n  }\r\n}<\/pre>\n<p><span style=\"font-size: 14pt;\">function.js<\/span><\/p>\n<p>The last step, Create a JavaScript file named &#8216;<em><strong>function.js<\/strong><\/em>&#8216; and put the codes.<\/p>\n<pre class=\"height-set:true height:750 lang:js decode:true \" title=\"function.js\">\/\/ Code By Webdevtrick (https:\/\/webdevtrick.com)\r\n$(document).ready(function(){\r\n  var zindex = 10;\r\n  \r\n  $(\"div.card\").click(function(e){\r\n    e.preventDefault();\r\n\r\n    var isShowing = false;\r\n\r\n    if ($(this).hasClass(\"d-card-show\")) {\r\n      isShowing = true\r\n    }\r\n\r\n    if ($(\"div.dashboard-cards\").hasClass(\"showing\")) {\r\n      $(\"div.card.d-card-show\")\r\n        .removeClass(\"d-card-show\");\r\n\r\n      if (isShowing) {\r\n        $(\"div.dashboard-cards\")\r\n          .removeClass(\"showing\");\r\n      } else {\r\n        $(this)\r\n          .css({zIndex: zindex})\r\n          .addClass(\"d-card-show\");\r\n\r\n      }\r\n\r\n      zindex++;\r\n\r\n    } else {\r\n      $(\"div.dashboard-cards\")\r\n        .addClass(\"showing\");\r\n      $(this)\r\n        .css({zIndex:zindex})\r\n        .addClass(\"d-card-show\");\r\n\r\n      zindex++;\r\n    }\r\n    \r\n  });\r\n});<\/pre>\n<p>That&#8217;s It. Now you have successfully created <strong>Bootstrap Expand Cards<\/strong> Animation With CSS, <strong>Bootstrap Collapsible Card<\/strong> Program. If you have any doubt or question comment down below.<\/p>\n<p><span style=\"font-family: impact, sans-serif;\">Thanks For Visiting, Keep Visiting.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How we can create expanding collapsible card using Bootstrap CSS JS? Solution: See this Bootstrap Expand Cards Animation With CSS, Bootstrap Collapsible Card. Previously I have shared some card programs, but this is an expandable card with collapse animation. Basically, this type of card majorly used in the backend site of websites because it takes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4229,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[48,43,46],"tags":[430,184,439,74,190,395,197,67,369],"class_list":["post-4228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bootstrap","category-css","category-javascript","tag-card","tag-cards","tag-collapsible","tag-css-animation","tag-example-and-source-code","tag-expandable","tag-jquery","tag-source-code","tag-toggle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card<\/title>\n<meta name=\"description\" content=\"Want to create card with collapse effect? Check out this Bootstrap Expand Cards Animation With CSS, Bootstrap Collapsible Card. Get source code now.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card\" \/>\n<meta property=\"og:description\" content=\"Want to create card with collapse effect? Check out this Bootstrap Expand Cards Animation With CSS, Bootstrap Collapsible Card. Get source code now.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Dev Trick\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webdevtrick\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-18T16:21:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-11-20T10:24:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"shaan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"shaan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/\"},\"author\":{\"name\":\"shaan\",\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/person\/c79bae83976f92fe305c22342b2a0be3\"},\"headline\":\"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card\",\"datePublished\":\"2019-11-18T16:21:50+00:00\",\"dateModified\":\"2019-11-20T10:24:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/\"},\"wordCount\":647,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/webdevtrick.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg\",\"keywords\":[\"card\",\"cards\",\"collapsible\",\"css animation\",\"example and source code\",\"expandable\",\"jquery\",\"source code\",\"toggle\"],\"articleSection\":[\"Bootstrap\",\"CSS\",\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/\",\"url\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/\",\"name\":\"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card\",\"isPartOf\":{\"@id\":\"https:\/\/webdevtrick.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg\",\"datePublished\":\"2019-11-18T16:21:50+00:00\",\"dateModified\":\"2019-11-20T10:24:28+00:00\",\"description\":\"Want to create card with collapse effect? Check out this Bootstrap Expand Cards Animation With CSS, Bootstrap Collapsible Card. Get source code now.\",\"breadcrumb\":{\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#primaryimage\",\"url\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg\",\"contentUrl\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg\",\"width\":1200,\"height\":630,\"caption\":\"bootstrap expand cards animation\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webdevtrick.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webdevtrick.com\/#website\",\"url\":\"https:\/\/webdevtrick.com\/\",\"name\":\"Web Dev Trick\",\"description\":\"HTML5, CSS3, JS, PHP Source Code &amp; Tutorial\",\"publisher\":{\"@id\":\"https:\/\/webdevtrick.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webdevtrick.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webdevtrick.com\/#organization\",\"name\":\"Web Dev Trick\",\"url\":\"https:\/\/webdevtrick.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/logo-fb-1.png\",\"contentUrl\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/logo-fb-1.png\",\"width\":512,\"height\":512,\"caption\":\"Web Dev Trick\"},\"image\":{\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webdevtrick\/\",\"https:\/\/pinterest.com\/webdevtrick\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/person\/c79bae83976f92fe305c22342b2a0be3\",\"name\":\"shaan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/60aa6ee93605bda7bc598d11dd748709a69bdb55a080124cc382114d8d7e7665?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/60aa6ee93605bda7bc598d11dd748709a69bdb55a080124cc382114d8d7e7665?s=96&d=mm&r=g\",\"caption\":\"shaan\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card","description":"Want to create card with collapse effect? Check out this Bootstrap Expand Cards Animation With CSS, Bootstrap Collapsible Card. Get source code now.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/","og_locale":"en_US","og_type":"article","og_title":"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card","og_description":"Want to create card with collapse effect? Check out this Bootstrap Expand Cards Animation With CSS, Bootstrap Collapsible Card. Get source code now.","og_url":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/","og_site_name":"Web Dev Trick","article_publisher":"https:\/\/www.facebook.com\/webdevtrick\/","article_published_time":"2019-11-18T16:21:50+00:00","article_modified_time":"2019-11-20T10:24:28+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg","type":"image\/jpeg"}],"author":"shaan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"shaan","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#article","isPartOf":{"@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/"},"author":{"name":"shaan","@id":"https:\/\/webdevtrick.com\/#\/schema\/person\/c79bae83976f92fe305c22342b2a0be3"},"headline":"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card","datePublished":"2019-11-18T16:21:50+00:00","dateModified":"2019-11-20T10:24:28+00:00","mainEntityOfPage":{"@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/"},"wordCount":647,"commentCount":1,"publisher":{"@id":"https:\/\/webdevtrick.com\/#organization"},"image":{"@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#primaryimage"},"thumbnailUrl":"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg","keywords":["card","cards","collapsible","css animation","example and source code","expandable","jquery","source code","toggle"],"articleSection":["Bootstrap","CSS","JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/","url":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/","name":"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card","isPartOf":{"@id":"https:\/\/webdevtrick.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#primaryimage"},"image":{"@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#primaryimage"},"thumbnailUrl":"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg","datePublished":"2019-11-18T16:21:50+00:00","dateModified":"2019-11-20T10:24:28+00:00","description":"Want to create card with collapse effect? Check out this Bootstrap Expand Cards Animation With CSS, Bootstrap Collapsible Card. Get source code now.","breadcrumb":{"@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webdevtrick.com\/bootstrap-expand-cards\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#primaryimage","url":"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg","contentUrl":"https:\/\/webdevtrick.com\/wp-content\/uploads\/bootstrap-expand-cards.jpg","width":1200,"height":630,"caption":"bootstrap expand cards animation"},{"@type":"BreadcrumbList","@id":"https:\/\/webdevtrick.com\/bootstrap-expand-cards\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webdevtrick.com\/"},{"@type":"ListItem","position":2,"name":"Bootstrap Expand Cards Animation With CSS | Bootstrap Collapsible Card"}]},{"@type":"WebSite","@id":"https:\/\/webdevtrick.com\/#website","url":"https:\/\/webdevtrick.com\/","name":"Web Dev Trick","description":"HTML5, CSS3, JS, PHP Source Code &amp; Tutorial","publisher":{"@id":"https:\/\/webdevtrick.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webdevtrick.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webdevtrick.com\/#organization","name":"Web Dev Trick","url":"https:\/\/webdevtrick.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdevtrick.com\/#\/schema\/logo\/image\/","url":"https:\/\/webdevtrick.com\/wp-content\/uploads\/logo-fb-1.png","contentUrl":"https:\/\/webdevtrick.com\/wp-content\/uploads\/logo-fb-1.png","width":512,"height":512,"caption":"Web Dev Trick"},"image":{"@id":"https:\/\/webdevtrick.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webdevtrick\/","https:\/\/pinterest.com\/webdevtrick\/"]},{"@type":"Person","@id":"https:\/\/webdevtrick.com\/#\/schema\/person\/c79bae83976f92fe305c22342b2a0be3","name":"shaan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdevtrick.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/60aa6ee93605bda7bc598d11dd748709a69bdb55a080124cc382114d8d7e7665?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/60aa6ee93605bda7bc598d11dd748709a69bdb55a080124cc382114d8d7e7665?s=96&d=mm&r=g","caption":"shaan"}}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/posts\/4228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/comments?post=4228"}],"version-history":[{"count":9,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/posts\/4228\/revisions"}],"predecessor-version":[{"id":4239,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/posts\/4228\/revisions\/4239"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/media\/4229"}],"wp:attachment":[{"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/media?parent=4228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/categories?post=4228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/tags?post=4228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}