Expanding a Fact or a box such as an according.
Created
December 12, 2014 08:11
-
-
Save ezos86/3be912fcdce42631a559 to your computer and use it in GitHub Desktop.
Fact Animation Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="fact"> | |
| Fact 1 | |
| </div> | |
| <div class="fact-content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse dignissimos cupiditate culpa assumenda commodi doloribus ullam accusamus, consectetur! Nulla repellendus nam veritatis dolorem provident ullam consequuntur quibusdam cupiditate repudiandae molestias. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta praesentium quisquam molestiae repudiandae. Fugit dolor quia impedit aspernatur ipsam? Accusantium impedit rem est odio voluptate? Rem recusandae porro, quia exercitationem. | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('.fact').click(function(){ | |
| $('.fact-content').toggleClass("fact-open"); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @import "compass/css3"; | |
| *{ | |
| box-sizing: border-box; | |
| } | |
| .fact{ | |
| font-size:18px; | |
| } | |
| .fact-content{ | |
| max-height:0px; | |
| @include transition(); | |
| overflow:hidden; | |
| background-color:#f1f1f1; | |
| } | |
| .fact:hover{ | |
| cursor: pointer; | |
| } | |
| .fact-open{ | |
| max-height:100px; | |
| display:block; | |
| position:relative; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment