Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
您尚未发布任何 HTML,因此我假设您使用的标记在菜单方面或多或少是“标准”的。
因此,假设您处于以下标记的范围内:
您可以使用类似以下内容来实现您想要的(根据我的理解):
这样,您在添加/删除时不必添加/更改任何代码
#menu
中的菜单项。You haven't posted any HTML, so I'm assuming that you're using markup which is more or less "standard" when it comes to menus.
So assuming that you're within the ballpark of the following markup:
You can achieve what you want (from what I understand), using something like:
This way, you don't have to add / change any code when you add / remove menu items from your
#menu
.您可以使用它,
如果需要的话可以添加额外的功能以使其更加具体。如果需要,可以将其重新用于您的内部内容。
请阅读 http://api.jquery.com/animate/ 了解更多信息。将 500 更改为您需要的任何高度。
You could use this
you can add extra functions if needed to make it more specific. This can be reused for your inner contents if need be.
Do read up on http://api.jquery.com/animate/ for more info. Change the 500 to any height that you need.