问题
I've 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");
});
What am I missing? It's such a minor issue in the grand scheme of what I'm building, but I won't move on until this is fixed. All assistance much appreciated.
来源:https://stackoverflow.com/questions/36352398/jquery-datepicker-showanim-not-animating