Event handlers for Twitter Bootstrap dropdowns?

前端 未结 7 2074
不思量自难忘°
不思量自难忘° 2020-12-14 04:59

I\'d like to use a Twitter Bootstrap dropdown button:

    
7条回答
  •  既然无缘
    2020-12-14 05:42

    Here is a working example of how you could implement custom functions for your anchors.

    http://jsfiddle.net/CH2NZ/43/

    You can attach an id to your anchor:

  • Action
  • And then use jQuery's click event listener to listen for the click action and fire you function:

    $('#alertMe').click(function(e) {
        alert('alerted');
        e.preventDefault();// prevent the default anchor functionality
    });
    

提交回复
热议问题