Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small js updates #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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