Skip to content

Instantly share code, notes, and snippets.

@sagarjadhav
Created October 10, 2013 06:36
Show Gist options
  • Save sagarjadhav/6914004 to your computer and use it in GitHub Desktop.
Save sagarjadhav/6914004 to your computer and use it in GitHub Desktop.
/* select element styling */
jQuery('.rtp-select').each( function() {
var self = jQuery(this),
title = self.attr('title');
if( jQuery('option:selected', this).val() !== '' ) title = jQuery('option:selected', this).text();
self
.css({
'z-index': 10,
'opacity': 0,
'-khtml-appearance': 'none'
})
.after('<span class="select">' + title + '</span>')
.change(function(){
val = jQuery('option:selected', this).text();
self.next().text(val);
})
});
/* Select List Style */
.rtp-select { height: 35px !important; line-height: 35px; position: relative; width: 220px !important; z-index: 10; }
.select { background: url('./img/down-arrow.png') no-repeat 96% 15px white; border: 1px solid #DDD; bottom: 0; color: #333; cursor: default; float: left; height: 35px; left: 0; line-height: 33px; position: absolute; text-indent: 6px; width: 220px; z-index: 1; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment