【问题标题】:why wouldn't this work in Firefox and Opera?为什么这在 Firefox 和 Opera 中不起作用?
【发布时间】:2011-04-05 00:23:45
【问题描述】:

所以我正在处理的 joomla 网站的画廊部分 (www.arrowandbranch.com/joomla/gallery) 使用 jquery 和 flickr API。这些网站在 IE、Safari 和 Chrome 中运行良好,但在 FireFox 和 Opera 中却不行。具体来说,在 FF 和 Opera 中,单击缩略图或相册标题不会正常加载左侧框中的图片。

我在这里做错了什么有什么想法吗?

【问题讨论】:

  • firefox 有错误控制台,你检查了吗?也可以使用萤火虫

标签: jquery firefox joomla opera flickr


【解决方案1】:

触发您的 javascript 的代码是导致问题的原因。

右边的缩略图有以下标记:

<a onclick=" $(document).ready(function(){ $('#photo2').flickrGallery({ useFlickr: 'true', flickrAPIKey: '2dc6307382340967ed44d0df77f888bf', photosetID: '72157625589504841', useHoverIntent: 'true', useLightBox: 'true'   });  }); " href="#">                      
    <img style="width: 100px; height: 100px;" alt="" src="http://farm6.static.flickr.com/5207/5310233198_7f8f2295ed_s.jpg" class="album-pic">        
</a>

问题来自 onclick 事件。您告诉它在 $(document).ready 上执行,这并不是您真正想要的。 $(document).ready 在页面首次加载时执行。如果事件是由点击触发的,那么只需使用不带 $(document).ready 的 onclick。

<a onclick="$('#photo2').flickrGallery({ useFlickr: 'true', flickrAPIKey: '2dc6307382340967ed44d0df77f888bf', photosetID: '72157625589504841', useHoverIntent: 'true', useLightBox: 'true'  });" href="#">                      
    <img style="width: 100px; height: 100px;" alt="" src="http://farm6.static.flickr.com/5207/5310233198_7f8f2295ed_s.jpg" class="album-pic">        
</a>

会正常工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-05-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-16
    相关资源
    最近更新 更多