Created
May 4, 2014 08:39
-
-
Save dogrunjp/11512915 to your computer and use it in GitHub Desktop.
jQueryで隣の要素をtoggleしつつトリガーのアイコンのイメージをtoggleに合わせ交互に変更する方法。
(Font Awsomeアイコンを使う場合)
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
$(".switch").click(function(){ | |
$(this).next().slideToggle(); | |
$("span",this).toggleClass("fa-mimus-square"); | |
$("span",this).toggleClass("fa-plus-square"); | |
}) |
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="switch"> | |
<span class="fa fa-mimus-square"></span> | |
</div> | |
<div>..</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment