1 | | I threw together this tiny plugin to help debug issues like this: |
2 | | |
3 | | {{{ |
4 | | // Log the selector used to select elements to each selected element, |
5 | | // otherwise to the body. Hover over logged selectors to highlight |
6 | | // stuff all fancy-like (note: don't select SPAN elements because this |
7 | | // creates them all over the place!) - Cowboy |
8 | | |
9 | | $.fn.logSelector = function() { |
10 | | var elems = $( '<span>' + this.selector + ' [' + this.length + ']</span>' ) |
11 | | .appendTo( this.length ? this : 'body' ); |
12 | | |
13 | | this.length && elems.hover(function(e){ |
14 | | elems.parent().andSelf().toggleClass( 'hover', e.type === 'mouseenter' ); |
15 | | }); |
16 | | |
17 | | return this; |
18 | | }; |
19 | | }}} |
| 1 | I threw together this tiny plugin to help debug issues like this: http://gist.github.com/640714 |