jQuery Datepicker showAnim not working

2019-03-05 11:33发布

问题:

I'v tried numerous ways and scoured the internet to try and make Animations work and have drawn a blank. I have the datepicker working and date format option but not animations (I'm looking to use the 'clip' option).

Here's what's in the various files -

Application.js

//= require jquery
//= require jquery.turbolinks
//= require jquery-ui/datepicker
//= require jquery_ujs
//= require turbolinks
//= require_tree .

Events.js.coffee

jQuery ->




    $("#datepicker").datepicker( 

        dateFormat: "DD, d MM, yy"


    );

_form.html.erb

<%= f.input :image, as: :file, label: 'Image' %>
<%= f.input :title, label: 'Title' %>
<%= f.input :location, label: 'Location' %>
<%= f.text_field :date, id: 'datepicker', label: 'Date' %>
<%= f.input :time, label: 'Time' %>
<%= f.input :description, label: 'Description' %>
<%= f.input :organised_by, label: 'Organised by' %>
<%= f.input :organiser_description, label: 'Organiser description' %>
<%= f.input :url, label: "Link to Organiser site" %>

<%= f.button :submit, label: 'Submit' %>

Application.css.scss

*= require_self
 *= require jquery-ui/datepicker
 */

@import 'normalize';
@import 'global.css.scss';
@import 'events.css.scss';
@import 'welcome.css.scss';

I've tried the following variations -

$ ->
$("#datepicker").datepicker();
$( "#datepicker" ).datepicker( "option", "showAnim", "clip");

$(document).ready(function(){


    $("#datepicker").datepicker(dateFormat: "DD, d MM, yy");

    $( "#datepicker" ).datepicker( "option", "showAnim", "clip");

});  

Among many others, what am I missing? It's such a minor issue in grand scheme of what I'm building but won't move on until this is fixed. All assistance much appreciated.