I am using the jquery 1.6.4 for timePicker. TimePicker is working fine but i want to change the position of timePicker . Whenever i click in textBox to open timePicker it opens on right side which is outside the mobile app screen . So how can i change its position ?
<script type="text/javascript">
$(document).ready(function(){
$('#sample1 input').ptTimeSelect();
});
</script>
Please try to change the position of textBox so that timePicker's position will be automatically changed .
I tried this on JSFiddle and for me it's opening just below the text box.
http://jsfiddle.net/adiioo7/XNgWB/
But in case if this issue still persists, you can use containerClass attribute and define your css for the date dialog positioning.
$(document).ready(function(){
$("#sample1").ptTimeSelect({containerClass:"test"});
});
This one is what you need.
$.extend($.datepicker,{_checkOffset:function(inst,offset,isFixed){offset.top = 0; offset.left=-100; return offset;}});
$(document).ready(function(){
$('#sample').datetimepicker();
});
You have to extend jQuery's datePicker default setup so the offset you set is in the extend
function, just change the offset.left
.
来源:https://stackoverflow.com/questions/14952466/how-to-change-the-timepicker-position