jquery selector parent on hover

Solutions on MaxInterview for jquery selector parent on hover by the best coders in the world

showing results for - "jquery selector parent on hover"
Gracie
05 Jun 2018
1$('table').on('hover', 'td', function () {
2    var selector = $('selector_in_td', $(this));
3    if (selector.length > 0) {
4        //Your code
5    }
6});
Kizzy
18 Jan 2017
1   //styling child while mouse is inside child element
2$('child').on('hover', function(e){
3   if (e.type == 'mouseenter'){
4      $(this).css('background','yellow');
5   }
6})
7
8   // styling child while mouse is inside parent
9$('child').parents().on('hover', function (e){
10   if (e.type == 'mouseenter'){
11      $(this).css('background', 'blue');
12   }
13})