admin管理员组文章数量:1333619
I am trying to get this lightbox to work and I'm not quite sure what I'm missing.
My relevant code is as follows:
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="jquery.js"></script>
<!-- Lightbox -->
<script type="text/javascript" src="jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.lightbox-0.5.css" media="screen" />
<script type="text/javascript">
$(document).ready(function() {
$("imgidas").lightBox();
});
</script>
</head>
The images are displyed in this manner:
<tr>
<td><a href="images/big-boss-adulto.jpg"><img src="images/big-boss-adulto.jpg" width="118" height="170" class="idas"/></a></td>
<td><a href="#"><img src="images/big-boss-cachorro.jpg" width="118" height="170" class="idas"/></a></td>
<td><a href="#"><img src="images/eukanuba-adulto.jpg" width="118" height="170" class="idas"/></a></td>
</tr>
(I'm only trying if the lightbox works on the first image)
The problem id the following, the lightbox gets stuck here (in the loading part):
Things I've checked and that I can infer:
- All the js and css are correctly linked and exist
- The javascript and styleshit of the lightbox are probable working correctly since:
- The style seems to be the correct
- When you click outside the image (or press esc) the lighbox disappears
Another thing I've checked was using load:
$(window).load(function() {
$("imgidas").lightBox();
});
But the same problem seems to persist.
I am trying to get this lightbox to work and I'm not quite sure what I'm missing.
My relevant code is as follows:
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="jquery.js"></script>
<!-- Lightbox -->
<script type="text/javascript" src="jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.lightbox-0.5.css" media="screen" />
<script type="text/javascript">
$(document).ready(function() {
$("img.idas").lightBox();
});
</script>
</head>
The images are displyed in this manner:
<tr>
<td><a href="images/big-boss-adulto.jpg"><img src="images/big-boss-adulto.jpg" width="118" height="170" class="idas"/></a></td>
<td><a href="#"><img src="images/big-boss-cachorro.jpg" width="118" height="170" class="idas"/></a></td>
<td><a href="#"><img src="images/eukanuba-adulto.jpg" width="118" height="170" class="idas"/></a></td>
</tr>
(I'm only trying if the lightbox works on the first image)
The problem id the following, the lightbox gets stuck here (in the loading part):
Things I've checked and that I can infer:
- All the js and css are correctly linked and exist
- The javascript and styleshit of the lightbox are probable working correctly since:
- The style seems to be the correct
- When you click outside the image (or press esc) the lighbox disappears
Another thing I've checked was using load:
$(window).load(function() {
$("img.idas").lightBox();
});
But the same problem seems to persist.
Share Improve this question edited Dec 15, 2011 at 5:14 Trufa asked Dec 15, 2011 at 4:56 TrufaTrufa 40.8k44 gold badges132 silver badges193 bronze badges2 Answers
Reset to default 4Try selecting the containing <a>
element, instead of the image itself, for the lightbox()
function.
You are targeting the wrong element in your JS. You need to target the anchor link around the image, rather than the image itself.
本文标签: javascriptjquery lightbox does not load imagesStack Overflow
版权声明:本文标题:javascript - jquery lightbox does not load images - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742277515a2445473.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论