Question: I'm trying to make slide navigation. Here is my code

html

```
<li>
    <a href="#">Services</a>
   <div class="subcategories">
    <a href="#">Cleaning</a>
  </div>
</li>

```

The subcategories div is hidden.

js

```
$('li a').hover(function() {
  $(this).next().slideToggle('fast', function() {

   });
});

```

This code works. The problem is that when the mouse goes out of the li a the subcategories div disappears. 

What i want is that when the user point the li a the subcategories div to be shown so the user be able to click on some link of the sub navigation.

Answer: 
It's a constrained least square problem. Basically you want to solve the optimization problem:

```
  argmin ||Ax-H||
    x
  s.t.  0<=x_j<=1

```

where `x=(x_1, ..., x_j, ..., x_n)` consists the coefficients you are seeking, and a column of `A` corresponds to a vector v\_i.
This is a combinatorial optimization problem. This kind of problems are NP-hard. But I guess for the binary one, there should be polynomial algorithms that can solve, or there may be some relaxation to get an approximate solution. Some googling on "integer programming" may help.