【发布时间】:2012-06-24 09:41:12
【问题描述】:
我的 js onclick 事件不适用于我的投资组合。该页面可以在这里看到:http://www.savantgenius.com/portfolio/branding 这是脚本:
<script type="text/javascript">
$(function() {
var portDefault = 'bonya';
$('#portItem').hide();
$('#portLoader').fadeIn();
$('#portItem').load('http://www.savantgenius.com/portfolio/portfolio-item/' + portDefault + ' #portLoadedContent', function() {
$('#portLoader').fadeOut();
$('#portItem').fadeIn();
});
$('a.focusElement').focus();
});
function get_portfolio(portLocation) {
$('#portItem').fadeOut();
$('#portLoader').fadeIn();
$('#portItem').load('http://www.savantgenius.com/portfolio/portfolio-item/' + portLocation + ' #portLoadedContent', function() {
$('#portLoader').fadeOut();
$('#portItem').fadeIn();
});
}
加载动画出现,但没有图像。任何想法都非常感谢,谢谢!
【问题讨论】:
-
您的代码中没有点击监听器...您是在尝试显示加载动画然后直接进入图像加载,还是在两者之间发生了实际用户提供的点击?
-
您在代码中的哪个位置声明了 click() 事件处理程序?
-
您正在尝试将图像的 原始数据 加载到您的 div 中。尝试使用
img标记返回一些 HTML,或者返回图像 src 并使用 jQuery 创建一个新的img元素 -
onclick 是针对他们页面上的锚元素,调用 get_portfolio()
标签: javascript onclick thumbnails portfolio