Last active
July 24, 2021 12:10
-
-
Save absent1706/6ebcee9f2d7992e26f073905fc28ca97 to your computer and use it in GitHub Desktop.
Bootstrap-collapse rotate icon. https://jsfiddle.net/1L3xy40k/
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<style> | |
[data-toggle="collapse"][aria-expanded="true"] > .js-rotate-if-collapsed | |
{ | |
-webkit-transform: rotate(180deg); | |
-moz-transform: rotate(180deg); | |
-ms-transform: rotate(180deg); | |
-o-transform: rotate(180deg); | |
transform: rotate(180deg); | |
} | |
</style> | |
</head> | |
<body> | |
<h3>Initially closed</h3> | |
<div style="cursor: pointer" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false"> | |
Header | |
<span class="glyphicon glyphicon-menu-down js-rotate-if-collapsed"></span> | |
</div> | |
<div id="collapseExample" class="collapse"> | |
Body | |
</div> | |
<hr> | |
<h3>Initially opened</h3> | |
<div style="cursor: pointer" data-toggle="collapse" data-target="#collapseExample2" aria-expanded="true"> | |
Header | |
<span class="glyphicon glyphicon-menu-down js-rotate-if-collapsed"></span> | |
</div> | |
<div id="collapseExample2" class="collapse in"> | |
Body | |
</div> | |
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
</body> | |
</html> |
Thanks, works like a charm
Thanks, worked really fine!
This is awesome, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, its work