【发布时间】:2013-03-05 09:56:49
【问题描述】:
您好,我正在尝试使用 jquery 缩放照片,它也可以正常工作。 demo。 但问题是我无法恢复以前的大小。 这是代码-
jQuery("#myimg").click(function () {
$(this).replaceWith( "<img id='myimgBig' src='http://www.gravatar.com/avatar/0f510b2337a6077896036f31d4f45eb7?s=420' width='420' height='420' title='that's me' alt='Uddhab' />" );
});
jQuery("#myimgBig").click(function () {
$(this).replaceWith( "<img id='myimg' src='http://www.gravatar.com/avatar/0f510b2337a6077896036f31d4f45eb7?s=120' width='120' height='120' title='that's me' alt='Uddhab' />" );
});
我想在#myimgBig 上单击返回#myimg。但是上面的代码不起作用:( 哪里错了!!请帮忙...
【问题讨论】:
标签: javascript jquery html css