jQuery .show('slide',{direction:'right'})不起作用,但是.show('slide') [英] jQuery .show('slide', { direction: 'right' }) doesn't work, but .show('slide') does
问题描述
我要在顶部菜单(ListItems)的开头插入菜单选项并使用
I'm inserting a menu choice at the beginning of a top menu (ListItems) and using
$('#newMenuItem').show('slide');
成功.但是,我不喜欢它从左上方滑入的方式,所以我将其更改为
successfully. However, I didn't like the way it slid in from the upper-left, so I changed it to
$('#newMenuItem').show('slide', { direction: 'right' });
不幸的是,一旦我更改了它,我将不再获得新的物品.实际上,没有比上述行低的代码了.
Unfortunately, once I changed it I no longer get the new item at all. In fact, no code lower than the above line is getting executed anymore.
有明显的原因为什么这行不通?我正在使用Visual Studio 2012附带的jquery-1.7.1.
Is there an obvious reason why this wouldn't work? I'm using jquery-1.7.1 shipped with Visual Studio 2012.
推荐答案
在特定方向上滑动的效果并不与香草jQuery捆绑在一起,而是属于此处的文档.
The effect of sliding in a specific direction doesn't come bundled with vanilla jQuery, but it's instead part of jQuery UI; including jQuery UI (in addition to jQuery) in your project should make it available. See also the documentation for the effect here.
这篇关于jQuery .show('slide',{direction:'right'})不起作用,但是.show('slide')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!