Responsive Ads Here

Thursday, 3 August 2017

How to stop Dropdown to close on click function (Stop Propogation)


we can stop the dropdown to close on Onclick function by using the Jquery function:

For whole dropdown in UI:

$("dropdown-menu").click(function(event){
    event.stopPropagation();
});

For specific Click function in UI:


Put the event.stopPropagation() call inside your condition. For example:

$el.click(function(event) {
    if (some_condition) {
        event.stopPropagation()
        // do stuff
    }
    else {
        // do other stuff, without stopping propagation
    }
});

No comments:

Post a Comment

On scroll Sticky footer

HTML5: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Sticky Footer | Co...

Contact Form

Name

Email *

Message *