html 文档之间的多向滚动
我一直在使用 jquery 进行多向滚动。我发现这是一种浏览网站的绝佳方式,但它有一个缺点。浏览器需要一次加载所有网站内容,因为它位于一个 html 文档中。
现在我一直在寻找一种在不同 html 文档之间进行出色滚动的方法,但没有成功。因此,我想知道是否可以在 html 文档之间滚动,而不是在 div 之间滚动。这可能吗?
I've been playing around with multi directional scrolling with jquery. I find this is a superb way to navigate through a website, but it has one drawback. The browser needs to load all site content at once because it's in one html document.
Now I have been searching unsuccessfully for a way to have this great scrolling between different html documents. So instead of scrolling between div's I wonder if it is possible to scroll between html documents. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这在客户端和服务器之间的请求/响应事务处理方式的正常意义上是不可能的 - 只有浏览器可以在此页面更改级别上动画更改。还有一些其他选项:
对于AJAX加载,jQuery的AJAX方法非常有用: http://api.jquery.com/jQuery.ajax /
只需传入 URL、您想要的任何信息和回调即可。在回调中,将响应数据加载到空
div
或任何位置。像这个例子,取自 jQuery 的网站:
This isn't possible in the normal sense of how Request/Response transaction between a client and a server - only a browser could animate changes on this page-change level. There are some other options:
For AJAX loading, jQuery's AJAX method is very useful: http://api.jquery.com/jQuery.ajax/
Simply pass in a URL, any info you want, and a callback. On the callback, load the response data into an empty
div
or wherever.Something like this example, taking from jQuery's site:
有两种方法可以实现这一目标。
There are two ways that you could get this accomplished.
是的,如果您将其他 html 页面预加载到 div 或 iframe(例如)。
Yes, if you preload other html pages to divs or iframes (for example).