jQuery: Mousover on a div open submenu which should stay open when mouseout

The trick requires two things:

A parent div that wraps both the initial menu (div 1) and the second menu (submenu)
Use the .mouseleave() method, NOT .mouseout() -- and bind this to the parent div mentioned in #1
jsFiddle example
http://jsfiddle.net/ebiewener/4cYzN/1/

You don't want to use mouseout(), because that will fire as soon as the cursor goes over the second menu, since this essentially "blocks" it from being over the parent div. mouseleave(), on the other hand, will only fire once the cursor is no longer over either the parent div,...

Get first element of an array PHP

array_shift(array_values($array));

answered Sep 22 '10 at 16:04

blueyed

Return index of highest value in an array

My solution is:

$maxs = array_keys($array, max($array))
Note:
this way you can retrieve every key related to a given max value.

If you are interested only in one key among all simply use $maxs[0]

GREATEST DATETIME Value When 1 Argument Maybe NULL

I have a table with 2 DATETIME columns, create_date and modify_date
I want to SELECT the GREATEST of the 2 columns.

SELECT GREATEST(asset_details.create_date, asset_details.modify_date) as pubdate
FROM asset_details

However, modify_date could be NULL (in fact most cases it is). The problem is GREATEST in MySQL 5 returns NULL if any of the arguments is NULL.

How can I write the SELECT with the results I need?

This Works.

SELECT GREATEST(COALESCE(asset_details.create_date, asset_details.modify_date), COALESCE(asset_details.modify_da...