dqingn8836 2011-11-25 20:44
浏览 75

AJAX导航和扩展图像

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!

  • 写回答

1条回答 默认 最新

  • douzhan1935 2011-12-01 11:10
    关注

    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:

    $('a:not(a.img)').livequery('click',function() {  
        $.address.value($(this).attr('href'));  
        return false;
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题