How to Prevent A SlideDown Event When Mouse Move Back to Handler Element
Can you please take a look at This Demo and let me know how I can prevent/stop slidedown function when user move back the cursor to the handler element
For example if you mouse over Home
the .tab-pane
will slide down and if you move mouse from the .tab-pane
to Home
tab it will re slide down the content. What I need to detect if mouse is coming from associated .tab-pane
do nothing
$('a[data-toggle="tab"]').hover(
- function(e) {
- $(this).parent().addClass('active');
- var target = $(this).data("target");
- $($(e.target).attr('href')).slideDown('slow');
- },
- function(e) {
- $(this).parent().removeClass('active');
- var target = $(this).data("target");
- var targetId = target.replace('#', '');
- var relatedTarget = $(e.relatedTarget);
- if (relatedTarget.attr('id') === targetId) {
- return;
- }
- $($(e.target).attr('href')).hide();
- }
- );
- $('.tab-pane').hover(function(e) {}, function() {
- $(this).slideUp('slow');
- $('.nav-tabs li').removeClass('active');
- });