My JQuery slider does not work in IE(in any documentmode). How could I fix this? My code slides down a div of text after a button is pressed(it fades in nicely too). The IE console gives me this error: "Object doesn't support property or method 'fadingSlideToggle'".
(function ($) {
$.fn.fadingSlideToggle = function ($el, options) {
var defaults = {
duration: 500,
easing: 'swing',
trigger: 'click'
};
var settings = $.extend({}, defaults, options)
$selector = $(this).selector;
return this.each(function () {
var $this = $(this);
$(document).on(settings.trigger, $selector, function (e) {
e.preventDefault();
if ($($el).css('display') == 'none') {
$($el).animate({
opacity: 'toggle',
height: 'toggle'
}, settings.duration, settings.easing);
} else {
$($el).animate({
opacity: 'toggle',
height: 'toggle'
}, settings.duration, settings.easing);
}
});
});
};
})(jQuery);
I wonder which part is not supported, and how to fix it. Thank you a lot!
EDIT: Here is the code where I call the function(it works on firefox and chrome):
<button class="btn-custom btn-lg"" id="clickedEl"><span>Why rate/review websites?</span> </button></br>
<nav role="navigation" id="toggleEl">/*non relevant html*/</nav>
The rest of the javascript:
$(function(){
$('#clickedEl').fadingSlideToggle('#toggleEl');
});
The JSFiddle that does not work in IE: http://jsfiddle.net/3ymvv