├── jquery.mobileselect.js ├── min └── jquery.mobileselect-min.js └── readme.md /jquery.mobileselect.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery Mobile Select 3 | * @Author: Jochen Vandendriessche 4 | * @Author URI: http://builtbyrobot.com 5 | * 6 | * @TODO: 7 | * - create a before / after hook so we can fix some things euhm... before and 8 | * after I suppose 9 | **/ 10 | 11 | (function($){ 12 | "use strict"; 13 | 14 | var methods = { 15 | init : function(config) { 16 | var options = $.extend({ 17 | autoHide: true, 18 | defaultOption: "Go to...", 19 | deviceWidth: 480, 20 | appendTo: '', 21 | className: 'mobileselect', 22 | useWindowWidth: false 23 | }, config); 24 | // we'll use the width of the device, because we stopped browsersniffing 25 | // a long time ago. Anyway, we want to target _every_ small display 26 | var width = (options.useWindowWidth === true) ? $(window).width() : screen.width; 27 | if (width < options.deviceWidth){ 28 | var _o = $(this), // store the jqyuery object once 29 | _p = (options.appendTo.length) ? $(options.appendTo) : _o.parent(), // get the parent node 30 | _s = $("