Posts

Showing posts from May, 2019

how to check first checkbox if any other else is checked, uncheck first checkbox if all other is unchecked

<div class="container">   <!-- <h2> check first checkbox </h2> -->   <form>     <label class="checkbox-inline">       <input type="checkbox"  value="1" name="state">State     </label>     <label class="checkbox-inline">       <input type="checkbox" value="2" name="district">District     </label>     <label class="checkbox-inline">       <input type="checkbox" value="3" name="Police_station">Police Station     </label>   </form> </div> <script> $('[type="checkbox"]:gt(0)').on('click', () => $('[type="checkbox"]:eq(0)').prop('checked', $('[type="checkbox"]:gt(0)').is(':checked'))); </script> //or <script> var $firstCb = $("input:checkbox...

Get Combo of two classes at same tag by Css.

<div class=" treeview-menu menu-open "  >  User Menu </div> Issue: To get the combination of two classes " treeview-menu   " and  " menu-open " , we have to call like this: Solution: div .treeview-menu.menu-open{   background-color:#f00;  color:#000 } Notice: There is no single space between both classes.

How to put two div side-by-side of the same height by Jquery and Css

<script type="text/javascript">  $(window).on('load',function(){     var ctntHeight = $("#contentBox").outerHeight();     $("#sidebar").css('min-height', ctntHeight);   });

AdminLTE2 Theme- Active menu item with multi level submenus (filter secure token) -

Image
When user click on the menu, page is reloaded and at that time current-active-menu  removed from the anchor tag(<a>). Paste below Jquery code in your header or footer file. This script is working OK  for Admin LTE2  treeview(submenu) sidebar  ==>  /** add active class and stay opened when selected */  $(window).on('load', function(){                                                                   // remember we are using secure token in our url, so firstly                                                                         we have to split and filter the url as we want var addr1 =$(...