I am looking to modify the Standard file upload button provided by JQuery Mobile to custom file upload button. (see below) Tried several ways to override the styling with not much success. Can someone please suggest how I can achieve this ?
Standard file upload button
Custom File Upload Buttom
<style>
div.fileinputs {
position: relative;
}
div.fakefile {
position: absolute;
top: 0px;
left: 0px;
z-index: 1;
}
div.fakefile input[type=button] {
/* enough width to completely overlap the real hidden file control */
cursor: pointer;
width: 426px;
}
div.fileinputs input.file {
position: relative;
text-align: right;
-moz-opacity:0 ;
filter:alpha(opacity: 0);
opacity: 0;
z-index: 2;
}
</style>
<script>
$(document).on('pageinit','#address_form',function (event){
$('#upload_button').parent('.ui-btn').css('width','334%');
})
</script>
<div data-role="page" id="address_form">
<div data-role="content">
<div class='container_12'>
<div class='grid_12 fileinputs' >
<input type="file" class="file" style='opacity:0;' />
<div class="fakefile" style='padding: 1.8%;' >
<input id='upload_button' type="button" value="Upload" style='' />
</div>
</div>
</div>
</div>
</div>