Posts

Showing posts from September, 2015

jQuery: How to close a dropdown on clicking anywhere on the body?

jQuery: How to close a dropdown on clicking anywhere on the body? The dropdown is displayed when user click on the 'more' button, to hide the dropdown again user should click on the 'more' button again. But if user want to close the dropdown by clicking anywhere on the body so we need add code on click document. HTML ----- <a class="select-link" href="https://www.blogger.com/blogger.g?blogID=3817399277949715318#"><a href="#" class="select-link">Select List</a> <ul class="dropdown-menu-list"> <li><a href="#">My item name 1</a></li> <li><a href="#">My item name 2</a></li> <li><a href="#">My item name 3</a></li> <li><a href="#">My item name 4</a></li> </ul> CSS --- .dropdown-menu-list {display:none;} jQuery --- $(".select-link")

MySql: Fixed sort datetime string field dd-mm-yyyy

If you using a system where the dates are stored as strings in the format dd/mm/yyyy or dd-mm-yyyy. Is it possible to convert this to yyyy-mm-dd in a sort Query. Table:Product year ---- 20-08-2015 02-03-2010 03-03-2011 02-03-2011 02-04-2011 SELECT `year` FROM `Product` WHERE 1 order BY DATE_FORMAT(STR_TO_DATE(`year`, '%d-%m-%Y'), '%Y-%m-%d') DESC