javascript - Unable to toggle div -
javascript - Unable to toggle div -
i'm working on project using jquery , asp.net. i'm trying create button hide/show div using jquery. here code have used:
<?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//fr" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <head runat="server"> <title> gestion des projets et des demandes </title> <link rel="stylesheet" href="style.css" type="text/css" media="screen" > <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('.minimize_button').click(function () { $('#my_div_example').stop().toggle('slow'); }); }); </script> </head> <body> <form id="form1" runat="server"> <input type="submit" value="_" class="minimize_button" /> <div class="big_div_content" id="my_div_example"></div> </form> </body> </html>
it seems not work, did wrong?
check working fiddle fiddle
you did event on click of submit ,so form submitted , u can utilize div.or utilize prevent submit on click of submit button.
<form id="form1" runat="server"> <div class="minimize_button">clickme</div> <div class="big_div_content" id="my_div_example"> toggling </div> </form>
javascript jquery asp.net
Comments
Post a Comment