css 可能是 jquery 帮助
我的设计师设计了以下导航
他希望实现它,以便导航下方的暗栏动画到当前页面加载页面(想想进度条)。对于 PHP 来说没有明显的问题,我可以对其进行排序,以便当前的 a
有一个类,这样我就可以识别当前页面,但是我不知道如何为导航下方的栏设置动画,有人有吗建议?
My designer has designed the following navigation
He is wanting it implmented so that the dark bar underneath the nav animates to the current page on page load (think progress bar). No obvioulsy with PHP I can sort it so that the current a
has a class so I can identify the current page, however I have no idea how I could animate the bar underneath the nav, does anyone have any advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你可以尝试这个 jquery 插件:
http://grasshopperpebbles.com/ajax/a-jquery-progress-bar-插件/
You could try this jquery plugin:
http://grasshopperpebbles.com/ajax/a-jquery-progress-bar-plugin/
抱歉,我会在这里发帖。
我认为你需要一个 div 内的 div 。外部 div(代表导航下方的整行)需要是整个导航的宽度。然后,您可以使用 jquery 将内部 div(进度条)设置为与上面的 nav 元素相同的宽度,并将其左侧位置设置为您已添加类的导航项的位置。
类似的东西
Sorry I'll post in here instead.
I think you would need a div within a div. The outer div (representing the full line underneath your navigation) would need to be the width of the total navigation. You could then use jquery to animate the inner div (progress bar) to the same width as the nav element above and animate its left position to that of the navigation item you have added the class to.
Something Like
$.animate({width: 195})
使其滚动。执行此操作,您的栏和文本都会移动。
如果您不关心文本,请跳过图像部分,只需制作一个灰色 div 来执行相同的操作。
有关动画效果,请参见 www.vouchr.com。
<div style="position:relative;">
<div style="position:absolute;top:0px;left:0px;height:100%;" id="progress">
$.animate({width: 195})
to get it to scroll.Do this and both your bar and text will move.
If you don't care about the text, skip the image part and just make a grey div that does the same thing.
See www.vouchr.com for the animation effect.