Created
December 11, 2016 16:39
-
-
Save kewang/d21efb73fa0a79926dc71c28b27b2de5 to your computer and use it in GitHub Desktop.
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
$(function(){ | |
$(".hide-form-title").click(function(){ // 點選 title 的時候 | |
$(this).siblings(".hide-form").slideToggle(function(){ // 找出同一層的 hide-form,然後開關 | |
var img = $(this).siblings(".hide-form-title").find("img"); // 然後再找回原來 title 裡面的 img | |
var src = img.attr("src"); // 把 src 找出來 | |
if (src === "images/down-arrow.png") { // 做上下箭頭的切換 | |
img.attr("src", "images/up-arrow.png"); | |
} else { | |
img.attr("src", "images/down-arrow.png"); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Javascript
CSS
HTML
from->form
<h3 class="hide-form-title">Inquiry Content <img src="images/down-arrow.png"></h3>
換成<h3 class="hide-form-title">Inquiry Content <img src="images/up-arrow.png"></h3>
<div class="contact-information">
再拉出來一層,很難用程式碼直接解釋Image