jQuery Lavalamp 问题:当单击链接并加载新的 php 内容时,滑块跳回原始位置(新手 q)
我正在开发一个位于此处的网站: http://temminktrainingcoaching.nl/beta/
有一个 lavalamp 菜单,当您单击链接时,它会通过在index.php中包含php文件(这是除徽标和菜单之外的所有内容)来加载页面。
结构或多或少如下:
<!-- index.php -->
<div id="logo + menu"></div>
<div id="some content"></div>
<div id="include">
<!-- seperate php files are include here -->
</div>
问题:当单击菜单中的链接并加载新的 php 页面,lavalamp 滑块会跳回其原始位置,但它应该停留在单击的链接处。
我是 jquery 新手,所以这只是一次尝试:但我认为解决此问题的最简单方法是向每个单独的 php 文件添加一段 javascript,将 lavalamp 滑块设置到正确的链接。
更多信息:我正在使用这个 lavalamp:http://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/
I am working on a site located here: http://temminktrainingcoaching.nl/beta/
There's a lavalamp menu, and when you click on the links it loads the pages by including php files in index.php (which is all content except for the logo and menu)
Structure is more or less as follows:
<!-- index.php -->
<div id="logo + menu"></div>
<div id="some content"></div>
<div id="include">
<!-- seperate php files are include here -->
</div>
Problem: When clicking on a link in the menu and loading a new php page, the lavalamp slider jumps back to it's original position, but it should stay at the clicked link.
I'm new to jquery, so it's just a try: but i thought the easiest way to fix this was to add a piece of javascript to each seperate php file which sets the lavalamp slider to the right link.
More info: I'm using this lavalamp: http://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如我所看到的,您可以在 php GET 参数中设置此菜单 x 位置,因为它在页面更新时设置为零位置。
更新:但无论如何,您应该稍微编辑一下 lavalamp 插件,以通过您自己的函数直接设置位置。脚本很短,无法编辑。
As I see, you can set this menu x position in php GET parameter, because it sets to zero position just when your page is being updated.
UPDATE: But anyway, you should edit your lavalamp plugin a little to set directly the position through your own function. Script is quite short to edit it.