0

似乎无法让我的灯箱工作。有任何想法吗?

<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" />

<title>WildFire</title>

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.lightbox-0.5.pack.js"></script>


<script type="text/javascript">
$(function() {
    // Use this example, or...
    $('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel

});
</script>


</head>

<body>

<div id="wrapper">

<div id="body">


<img src="images/tempbar.png">

<div id="text">

<img class="logo" src="images/logo.png">


<ul class="info">
<li>Hours: </li>
<p>
<li> Lunch 11am - 3pm </li>
<li> Dinner 5pm - 10pm </li>
<p>
<li>Phone: </li>
<p>
<li>(607) 277-9143</li>
<p>
<li>Address: </li>
<p>
<li> 106 S Cayuga St </li>
<li>Ithaca, NY 14850 </li>


</ul>

<p class="linkouts">

<a rel="lightbox" "href="images/lunch.png">
<img src="images/lunchlink.png">
</a>

<p>


<img src="images/dinnerlink.png">


</div>



</div>

<div id="footer">

For Lounge Events Find Us On 

<a href="http://www.facebook.com/pages/Ithaca-NY/WildFire-Lounge/144229581885?ref=ts" target="_blank">
<img class ="fb" src="images/loungefb.png">
</a>

Come Visit

<a href="http://www.madelines-restaurant.com/" target="_blank">
<img class="mad" src="images/madelineslogo.png">
</a>

And Our Friend

<a href="http://www.stateofithaca.com/" target="_blank">
<img class="state" src="images/stlogo.png"
</a>


</div>


</div>
</body>
</html>
4

2 回答 2

2

您的选择器不正确,不再使用“@”(已弃用,大声笑,如果没有早上的咖啡,我想不出这个词)。试试这个:

$(function() {
 $('a[rel="lightbox"]').lightBox();
});
于 2009-11-07T13:47:14.543 回答
1

在没有测试任何其他内容或仔细查看问题的情况下,您是否尝试过从 href 属性之前删除不正确放置的引号?

<a rel="lightbox" href="images/lunch.png">
<img src="images/lunchlink.png">
</a>
于 2009-11-07T08:13:46.850 回答