reworked how index of item is calculated

using jquery index() create incorrect index if additional items are in
the parent element (tooltips, etc)