我有一些縮略圖下面的代碼:關於jQuery的圖像縮放效果
<img onclick="if($(this).hasClass('zoom'{
this.src='http://24.media.tumblr.com/tumblr_m2uql6rJsI1r9fv99o1_100.gif';
$(this).animate({'width':'100','height':'50'}).removeClass('zoom')
}else{
this.src='http://27.media.tumblr.com/tumblr_m2uql6rJsI1r9fv99o1_500.gif';
$(this).animate({'width':'500','height':'268'}).addClass('zoom')
}"
style="width: 100px; height: 50px;"
src="http://24.media.tumblr.com/tumblr_m2uql6rJsI1r9fv99o1_100.gif" >
它的工作原理,但我不希望這種風格,我的網站,我想是這樣的:
<script type="text/javascript">#$^%@^&*$#$^#@%</script>
但太複雜了,我不能寫......所以誰能幫助我?
SOURCE在這裏:http://jsfiddle.net/My39T/
的另一個問題是,我需要動畫,所以這些圖像需要的寬度/高度。我能做到這一點,但我沒有圖像寬度/高度,所以也許需要這樣的:
$('img').each(function() {
$(this).attr('height',$(this).height());
$(this).attr('width',$(this).width());
});
你的問題不清楚,這是什麼意思#$ ^%@ ^&* $#$ ^#@%?你想要哪種風格? – Peeyush 2012-04-22 06:32:17
@Peeyush:我認爲一串無法辨認的人物是他不懂JavaScript的溝通方式。 – 2012-04-22 06:47:55
#$ ^%@ ^&* $#$ ^#@%===== 有些像這樣 – metalbug 2012-04-22 07:36:15