Permalink
Browse files

add an option of "className" to allow for styling

  • Loading branch information...
1 parent ece821f commit 000344ebe3ea653b2561538cc539fc4c8b9c1a72 @erunyon committed Dec 22, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 jquery.mobileselect.js
View
@@ -4,7 +4,7 @@
* @Author URI: http://builtbyrobot.com
*
* @TODO:
- * - create a before / after hook so we can fix some things euhm... before and
+ * - create a before / after hook so we can fix some things euhm... before and
* after I suppose
**/
@@ -16,14 +16,15 @@
var options = $.extend({
autoHide: true,
defaultOption: "Go to...",
- deviceWidth: 480
+ deviceWidth: 480,
+ className: 'mobileselect'
}, config);
// we'll use the width of the device, because we stopped browsersniffing
// a long time ago. Anyway, we want to target _every_ small display
if (screen.width < options.deviceWidth){
var _o = $(this), // store the jqyuery object once
_p = _o.parent(), // get the parent node
- _s = $("<select />"); // create a filthy select
+ _s = $("<select class=\""+ options.className +"\" />"); // create a filthy select
_s.appendTo(_p); // append it to the parent
$("<option />", {
@@ -32,7 +33,7 @@
"text": options.defaultOption
}).appendTo(_s);
- // Populate the dropdown with menu items. If there is an li.current we'll
+ // Populate the dropdown with menu items. If there is an li.current we'll
// make this one selected
$('a', _o).each(function() {
var el = $(this),

0 comments on commit 000344e

Please sign in to comment.