【问题标题】:jquery calendar stops working on desktop but works on mobilejquery calendar 停止在桌面上工作,但在移动设备上工作
【发布时间】:2019-04-30 05:45:27
【问题描述】:

jquery 日历有一个奇怪的问题,我的代码在 flatsome 主题 wordpress 中的一个块(小部件)中,它与我用于桌面和移动版本的标题生成器的块相同。它在移动中打开日历而不是桌面,如果我交换东西,它将在桌面而不是移动设备中打开。

我的代码对日历是否正确,或者这里有明显的问题 下面的主题子函数

{
    wp_enqueue_script('jquery-ui-datepicker');
}

function custom_style_sheet() {
    wp_enqueue_style('custom-styling', get_stylesheet_directory_uri().
        '/datepicker.css');
}
add_action('wp_enqueue_scripts', 'custom_style_sheet');

日历表格代码

<form class="bookingquery" action="externalurl" autocomplete="off" method="post" novalidate="novalidate" target="_blank">
<input id="In" class="checkin" style="width: 100%; height :50px; 
cursor: pointer;" name="In" readonly="readonly" type="text" value="" placeholder="Check In" />
<script>
    jQuery(document).ready(function() {
        jQuery('#In').datepicker({
            dateFormat: 'dd-mm-yy',
            minDate: 0,
            yearRange: '00:+02',
            orientation: "top",
            autoclose: true,
            yearSuffix: ''
        });
    });
</script>
<input id="Out" class="checkout" style="width: 100%; height :50px; 
cursor: pointer;" name="Out" readonly="readonly" type="text" value="" placeholder="Check Out" />
<script>
    jQuery(document).ready(function() {
        jQuery('#Out').datepicker({
            dateFormat: 'dd-mm-yy',
            minDate: +1,
            yearRange: '00:+02',
            orientation: "top",
            autoclose: true,
            yearSuffix: ''
        });
    });
</script>
<input id="Guests" name="Guests" type="hidden" value="2" />
<button class="form-submit-booking" type="submit">Search</button>
</div>

【问题讨论】:

    标签: jquery wordpress forms calendar


    【解决方案1】:

    似乎flatsome主题在标题中存在冲突,因为它两次调用代码 在页面中工作正常

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-18
      • 1970-01-01
      • 1970-01-01
      • 2012-06-14
      相关资源
      最近更新 更多