To open a slide

I have a page, when the user clicks the title, the following divs are displayed.

I want to say somehow whether any other divs will be displayed: then the block will first set them to display.

I thought maybe I could do it like this, but I think I'm using it in the wrong context. The code is worthless.

HTML:

<div id="recordbox" class="home" style="z-index: 2; background: #f2f2f2;"> <div class="jlkb"></div> <div id="recordlist"> <div class="jlmain j1"> <div class="jlhead"> <div class="jlleft"> <li>存款金额: 10.00</li> <a>2016-09-21 18:39:02</a> </div> <div class="jlright"> <li class=""></li> </div> </div> <div class="jldetail" style="display:none"> <p>充值方式:在线订单号:20160921183902323</p> <p>状态:待支付</p> </div> </div> </div> </div> 

JQUERY:

 function BindList() { $(".jlmain").unbind("click"); $(".jlmain").click(function () { $(this).find(".jlright li").toggleClass("jlmain1"); $(this).find(".jldetail").slideToggle("fast"); }) } 
+5
source share
1 answer

He works.

Here is the code.

 <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function(){ $(".jlmain").unbind("click"); $(".jlmain").click(function () { console.log('here'); $(this).find(".jlright li").toggleClass("jlmain1"); $(this).find(".jldetail").slideToggle("fast"); }); }); </script> </head> <body> <div id="title">Title</div> <div id="recordbox" class="home" style="z-index: 2; background: #f2f2f2;"> <div class="jlkb"></div> <div id="recordlist"> <div class="jlmain j1"> <div class="jlhead"> <div class="jlleft"> <li>存款金额: 10.00</li> <a>2016-09-21 18:39:02</a> </div> <div class="jlright"> <li class=""></li> </div> </div> <div class="jldetail" style="display:none"> <p>充值方式:在线订单号:20160921183902323</p> <p>状态:待支付</p> </div> </div> </div> </div> </body> </html> 
+3
source

All Articles