AJAX 导航和扩展图像
我有一个带有主页index.php 的网站,当单击index.php 中的菜单项时,我会使用JQuery Address 将内容加载到该主页中。
在加载到 #content 的其中一个页面中,有一些图像我使用 Highslide 来展开。问题是,当图像扩展到 #content div 的边界时,该 div 会被清空并被乱码取代(����JFIF 等)。
有什么方法可以使用此 AJAX 导航来获得可缩放的图像吗?
编辑: 如果我复制 Highslide 代码并在加载到 #content div 的页面中重新加载 JQuery,它就可以工作:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<link rel="stylesheet" href="js/highslide/highslide.css" type="text/css" />
<script src="js/highslide/highslide.js" type="text/javascript"></script>
<script type="text/javascript">
hs.graphicsDir = 'js/highslide/graphics/';
</script>
但这意味着这些 js 调用在页面上进行了两次,并且出于我不清楚的原因,这意味着index.php 上的其他 jquery 脚本(包括 Address)不再工作...任何帮助将不胜感激!
I have a site with a main page, index.php, with a into which I load content when a menu item in index.php is clicked, using JQuery Address.
In one of the pages loaded into #content, there are images which I use Highslide to expand. The trouble is when the image expands over the boundary of the #content div, this div gets emptied and replaced with gibberish (����JFIF etc.).
Is there any way to have an zoomable image using this AJAX navigation?
EDIT:
It works if I duplicate the Highslide code and reload JQuery within the page loaded into the #content div:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<link rel="stylesheet" href="js/highslide/highslide.css" type="text/css" />
<script src="js/highslide/highslide.js" type="text/javascript"></script>
<script type="text/javascript">
hs.graphicsDir = 'js/highslide/graphics/';
</script>
but this then means that these js calls are being made twice on the page, and for a reason I'm not clear on, this means that the other jquery scripts on index.php, including Address, don't work any more... Any help would be hugely appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我错过了一些明显的东西。包装每个要扩展的图像的标签由我的 Address 调用拾取,我已将其自动附加到每个标签。所以我只是为图像添加了一个类并将其从调用中排除:
I was missing something obvious. The tag that wrapped every image to be expanded was being picked up by my Address call, which I had automatically attached to every tag. So I just added a class for the images and excluded it from the call: