html - jQuery hide() doesn't work well -


dear all,

i've faced following problem while. please me out!

here's code:

html

<html>  <head>   <meta charset="utf-8" />     <!--css stylesheet-->   <link href="style.css" rel="stylesheet" />    <!--jquery external javascript - cdn-->   <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>   <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>   <link href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" rel="stylesheet" />  </head>  <body>    <div class="header"></div>    <div class="content"><input type="button" id="senddata" value="send data" align="center"></div>    <div class="barchart"><input type="button" id="reenterbutton" value="re-enter">     </div>  </body>  </html> 

css

.content {   text-align: center;   background-color: white;   width: 650px;   height: 650px;   display: inline-block;   position: relative; }    .barchart {   text-align: center;   background-color: white;   width: 650px;   height: 650px;   display: inline-block;   position: relative;   display: none;            // make .barchart hide } 

javascript

<script type="text/javascript"> $(document).ready(function() {    $("#senddata").button()                                    .click(function() {                           $("div.content").hide("slide", {direction: "left"}, "slow", function() {                     $("div.barchart").show("slide", {direction: "right"}, "slow");                   });                  });     $("#reenterbutton").button()                  .click(function() {                   $("div.barchart").hide("slide", {direction: "right"}, "slow", function() {                        $("div.content").show("slide", {direction: "right"}, "slow");                   });                  }); }); </script> 

the #senddata button works fine, click on #reenterbutton doesn't work on second statement(the 1 selector("div.barchart")).

.barchart doesn't hide after applying click action on reenter button.

situation related div status set in css file? or else?

thanks help!

you have typo on second click binding, instead of $("div.barchart") should $("div.barchart")

fiddle


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -