Answers for "jquery selector parent on hover"

0

jquery selector parent on hover

$('table').on('hover', 'td', function () {
    var selector = $('selector_in_td', $(this));
    if (selector.length > 0) {
        //Your code
    }
});
Posted by: Guest on June-05-2020
0

jquery selector parent on hover

//styling child while mouse is inside child element
$('child').on('hover', function(e){
   if (e.type == 'mouseenter'){
      $(this).css('background','yellow');
   }
})

   // styling child while mouse is inside parent
$('child').parents().on('hover', function (e){
   if (e.type == 'mouseenter'){
      $(this).css('background', 'blue');
   }
})
Posted by: Guest on June-05-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language