不重新加载的导航栏 [英] Navigation bar that doesn't reload

查看:64
本文介绍了不重新加载的导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很愚蠢的问题.在过去的几周里,我一直在使用出色的Bootstrap/Twitter组件编写Ruby On Rails应用程序,以避免我不得不做任何艺术性的事情.

I have what is probably a very stupid question. I have been writing a Ruby On Rails app for the last few weeks, using the excellent Bootstrap/Twitter components to avoid me having to do anything artistic.

我在该网站上注意到,导航栏似乎从未重新加载.

I noticed on that site, the navigation bar does not appear to ever reload.

http://twitter.github.com/bootstrap/javascript.html

单击最顶部的链接(概述",脚手架"等)会导致页面更改和URL更改,但顶部栏本身似乎不会重新加载.

Clicking on the links at the very top (Overview, Scaffolding, etc) causes the page to change, and the URL to change, but the topbar itself does not appear to reload.

我无法检测到任何可以进行此操作的AJAX-y(使用Chrome的开发工具栏等).我只能想象是这样:

I can't detect anything AJAX-y going on that would do this (using Chrome's dev toolbar etc). I can only imagine that it's:

  • 一种错觉,它正在重新加载,只是速度如此之快,我看不到它.但是,为什么它似乎没有与内容同时重新加载?

  • An optical illusion, and it is reloading just it's so fast I can't see it. But then why does it not appear to reload at the same time as the content?

一些无法检测到的AJAX正在进行

Some undetectable AJAX going on

任何想法都值得欢迎:)

Any thoughts most welcome :)

推荐答案

boostrap网站的导航栏似乎确实在重新加载过程中是静态的,但这并不是一些聪明的js在做.没有正在显示的隐藏内容.

The boostrap site's navbar does seem to be static during reloads but it isn't some clever js that is doing that. There is no hidden content that is being displayed.

这里发生的是非常快速的页面加载.boostrap的家伙将所有js链接和脚本都移到了html的底部,因此页面加载速度更快,他们甚至在html中说了这一点.页面加载速度如此之快,以至于某些元素(如导航栏)似乎根本没有改变.我在现场和低处尝试过,发现静态导航栏错觉.

What's happening here is a very fast page load. The guys at boostrap moved all their js links and scripts to the bottom of their html so their pages load faster, they even say that in their html. The pages load so much faster that certain elements like the navbar don't seem to change at all. I tried it on my on site and low and behold the static navbar illusion.

因此也许将js和脚本移到html的底部可以帮助您实现相同的技巧.

So maybe moving your js and scripts to the bottom of your html can help you achieve the same trick.

这篇关于不重新加载的导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆