0
之前,我得到缺少jQuery插件;声明(jQuery的)
在下面的代码SyntaxError: missing ; before statement }) (jQuery);
。我试图做一个jQuery插件,我看不出有什么错在这里:
(function($) {
$.fn.hideElement = function(options) {
options = $.extend({}, $.fn.hideElement.defaults, options);
return this.each(function(){
var wrapping = $(this).css('white-space');
$(this).css({'white-space':'nowrap'})
.animate(options.toggling,1000, function(){
$('<p>').text('»')
.insertAfter($(this))
.click(function(){
$(this).prev()
.animate(options.toggling,1000)
.css({'white-space':wrapping})
.next().remove();
});
});
});
$.fn.hideElement.defaults = {
'toggling':'width',
}
}) (jQuery);
'$ .fn.hideElement =功能(选件){'未关闭。在}}(jQuery)前添加'}';' – Popnoodles