我有这部法典半途运作。
jQuery( #checkbox ).click(function () {
jQuery( .cssBox ).animate({height: +=50px }, 500);
jQuery( #extra ).toggle(this.checked);
});
现在,当检查箱时,盒子就有了扩大,但是当盒子被封不动时,箱子就会变得更大。 我怎么能够加以调整,以便当不加控制时,它回到原来的规模?
我有这部法典半途运作。
jQuery( #checkbox ).click(function () {
jQuery( .cssBox ).animate({height: +=50px }, 500);
jQuery( #extra ).toggle(this.checked);
});
现在,当检查箱时,盒子就有了扩大,但是当盒子被封不动时,箱子就会变得更大。 我怎么能够加以调整,以便当不加控制时,它回到原来的规模?
问题如下:
jQuery( #checkbox ).click(function () {
jQuery( .cssBox ).animate({height: ((this.checked)? +=50px : -=50px )}, 500);
jQuery( #extra ).toggle(this.checked);
});
使用<代码>change而不是click
(通过和使用空间条码进行其他制片将绕过你的代码)。 另外,根据<条码>条码条码>采用您的计算方法。 国家:
jQuery( #checkbox ).change(function(){
jQuery( .cssBox ).animate({
height: this.checked // is it checked?
? +=50px // yes, increase by 50px
: -=50px // no, decrease by 50px
},500);
jQuery( #extra ).toggle(this.checked);
});
$(function(){
var isSmall=true;
$( #checkbox ).click(function () {
if(isSmall)
{
$( .cssBox ).animate({height: +=50px }, 500);
}
else
{
$( .cssBox ).animate({height: -=50px }, 500);
}
isSmall=!isSmall;
});
});
Sample : 。
The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...
How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.
I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...
I have a div <div id="masterdiv"> which has several child <div>s. Example: <div id="masterdiv"> <div id="childdiv1" /> <div id="childdiv2" /> <div id="...
I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.
I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...
Ok, I m stumped. Basically, this script works fine in FF, but not in IE (6,7 or 8) - in which it returns an "Object doesn t support this property or method" error. Any ideas?: function ...
What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...