2018年1月16日 星期二

jquery datapickup UI

if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
$(“#date”).datepicker(“destroy”);
$(“#date”).prop(“type”, “date”);
//(注意日期格式要調整成跟datepicker 日期格式一樣)
}

 

參考:https://blog.user.today/rwd-mistake/

變更寬度
$( document ).ready( function(){     setMaxWidth();     $( window ).bind( "resize", setMaxWidth ); //Remove this if it's not needed. It will react when window changes size.      function setMaxWidth() {     $( "#mainContainer" ).css( "maxWidth", ( $( window ).width() * 0.7 | 0 ) + "px" );     }  });