どうすれば画像をonClickに変更できますか?それを元の状態(元の画像)に戻しますか?Onclick Change Image、jQuery?
jQuery('.expand-one').click(function(){
jQuery('.content-one').slideToggle('fast');
});
jQuery('.expand-one').toggle(function() {
jQuery('.content-one').slideDown('slow');
jQuery(this).find("img").css({
"-webkit-transform": "rotate(90deg)",
"-moz-transform": "rotate(90deg)",
"filter": "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"
});
}, function() {
jQuery('.content-one').slideUp('slow');
jQuery(this).find("img").css({
"-webkit-transform": "rotate(0deg)",
"-moz-transform": "rotate(0deg)",
"filter": "progid:DXImageTransform.Microsoft.BasicImage(rotation=0)"
});
});
事実上、イメージスワッピングのイメージローテーションを変更したいと思います。
おかげで、 アーロン
としてJavaScriptを持っています...これはあなたが探しているものですか? jQuery(this).find( "img")。attr( "src"、 "new/image/path/image.ext"); – Connum
@ Connum:私はそう思います。私はonClickイベントを使用してIMGの現在の状態を交換したいですか?それは理にかなっていますか?笑。 –
"state"を定義しますか? ;-) – Connum