ToggleFade() Function Problem in jQuery [Resolved]

Posted by Akiii under jQuery on 5/19/2011 | Points: 10 | Views : 4381 | Status : [Member] | Replies : 3
Hi,
I have a div which i want to toggle fade but its not working. I am pasting the code below:-

<form id="form1" runat="server">
<div id="divTestArea4" style="width: 50px; height: 50px; display: none; background-color: #89BC38;"></div><br />

<a href="javascript:void(0);" onclick="ToggleBox();">Toggle box</a>
</form>


function ToggleBox() {
$("#divTestArea4").fadeToggle("slow");
}


Could anyone tell me what's wrong in the code !

Thanks and Regards
Akiii




Responses

Posted by: SheoNarayan on: 5/19/2011 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
Couple of things you can investigate

1. Ensure that latest jQuery file is referenced in your page.
2. Look at this article - http://api.jquery.com/fadeToggle/

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Akiii, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Tijut2k on: 5/19/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
May help this link
http://jqueryui.com/demos/toggle/
http://api.jquery.com/fadeToggle/

<html> 

<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<button>fadeToggle p1</button>
<button>fadeToggle p2</button>
<p>This paragraph has a slow, linear fade.</p>
<p>This paragraph has a fast animation.</p> <div id="log"></div>
<script> $("button:first").click(function()
{ $("p:first").fadeToggle("slow", "linear");
});
$("button:last").click(function () {
$("p:last").fadeToggle("fast", function ()
{
$("#log").append("<div>finished</div>");
});
});
</script> </body> </html>


Best Regard's
Tiju Thankachan

Akiii, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 5/19/2011 [Member] Bronze | Points: 25

Up
0
Down
@sheo.....Thank you sir for your recommendation, the problem was that the latest version was not included........
I included it and now its working fine........

@Tiju .......Thank you for the excellent links....
the code works fine....

jquery is great !!!

Regards
Akiii

Akiii, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response