Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions jquery.fancydropdown.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
return this.each(function() {
var el = $(this);
var id = $(this).attr('id');
el.hide();
el.css({'position': 'absolute', 'left': '-999em'});
//create needed HTML
var html = '<div class="dropdown" id="'+id+'_dropdown"></div><ul class="dropdownlist" id="'+id+'_dropdownlist">';
$('option', el).each(function() {
Expand All @@ -43,7 +43,7 @@
if (private.bound_click_customdropdown === undefined) {
//bind the click event only once
private.bound_click_customdropdown = true;
$('body').bind('click.customdropdown', function(e) {
$('body').bind('click.customdropdown touchstart', function(e) {
var elements = $(e.target).parents().andSelf();
var dropdown = elements.filter('.dropdown');
var dropdownlist = elements.filter('.dropdownlist');
Expand Down Expand Up @@ -81,6 +81,7 @@
$(dropdownlist[0]).fadeOut('fast');
//reflect change to original <select> element
$("#"+dropdownid.slice(0, -9)).val(li.attr('data-realvalue'));
e.preventDefault();
}
}
});
Expand Down