jquery 加载内容并为 iframe 制作动画
我试图在单击菜单按钮时实现内容滑动(和缓动)的效果。这将适用于具有不同内容(图库、作品集、视频等)和某些页面上会滑入的子菜单的普通网站。
我已经了解了所有可在预加载和隐藏的 div 中滑动的滑动插件(如 coda 滑块) 。但我担心如果我在第一页加载整个网站,那听起来就是错误的。另一方面,使用 iframe 进行操作并使用 load() 加载数据,我不确定是否可以滑动和缓和数据(如 coda 滑块示例 8)。
有没有人以前做过这个或有相同的想法并且不介意分享? 将不胜感激!
I'm trying to achieve an effect of content sliding (and easing) in a menu button when it is clicked. It would be for a normal site with different content (gallery, portfolio, videos, etc) and submenus on some pages that would slide in.
I have learned about all the sliding plugins (like coda slider) that slide through pre loaded and hidden divs. but i have concerns that if i load the whole website on the first page, that just sound wrong. on the other hand doing it with iframes and loading in data with load() i'm unsure i can slide and ease the data in (like coda slider example 8).
has anyone done this before or had the same idea and wouldn't mind sharing?
would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我目前正在为我们的 api 开发类似的功能。我加载一个带有行链接的菜单 div,将 ajax 内容拉入“视图”div,然后将菜单动画化,然后将视图动画化到主 iFrame 中。这很容易做到,所以请查看下面我的一些 javascript 和 html。当我把这个推上去时,我会回来更新答案,你可以对成品进行挖掘。希望这有帮助。
matchHolder 用于显示加载的内容,并被赋予 -600px 位置,因此它隐藏在 iFrame 顶部之外。然后我打电话去获取一场比赛的记分卡,
目前所有这些都非常松散地组合在一起,但我希望这能让您知道从哪里开始并且可以做到这一点。谢谢。
I am currently working on a similar feature for our api. I and loading a menu div with rows of links which pull ajax content into a"view" div, I then animate the menu away and then animate the view into the main iFrame. This was so easy to do so check out some of my javascript and html bellow. When I push this up i'll come back and update the answer you you can have a dig around the finished product. Hope this helps.
The matchHolder is used to display the loaded and content and is given a -600px position so its hidden outside the top of the iFrame. Then I make a call to get the scorecard for a match
All very loosely put together at the moment but I hope this gives you an indication of where to start and that it is possible to do it. Thanks.
我编写了 Coda Slider,最近还编写了 Liquid Slider,它是 Coda Slider 的响应式版本。
我还编写了一个简短的教程,介绍如何使用 Ajax 在单击面板后加载 Twitter 源。我希望这会有所帮助...
http://liquidslider.kevinbatdorf.com/tutorials/dynamically-add-content-to-a-panel-when-clicked-using-ajax/
I wrote the Coda Slider, and have recently also wrote the Liquid Slider, which is the responsive version of the Coda Slider.
I also wrote a short tutorial about how you can load Twitter feeds after a panel is clicked, using Ajax. I hope this helps...
http://liquidslider.kevinbatdorf.com/tutorials/dynamically-add-content-to-a-panel-when-clicked-using-ajax/