阻止默认事件触发
This commit is contained in:
parent
841fd90b2e
commit
0195b8cd5f
|
@ -331,7 +331,8 @@
|
||||||
var $select = $element.find('button').first();
|
var $select = $element.find('button').first();
|
||||||
var $options = $element.find('.dropdown-menu > li > a');
|
var $options = $element.find('.dropdown-menu > li > a');
|
||||||
$select.addClass('select').data('options', $options);
|
$select.addClass('select').data('options', $options);
|
||||||
$options.on('click', function () {
|
$options.on('click', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
var $op = $(this);
|
var $op = $(this);
|
||||||
$select.text($op.text()).attr('data-val', $op.attr('data-val'));
|
$select.text($op.text()).attr('data-val', $op.attr('data-val'));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue