2011-08-30 30 views
1

我試圖使用jquery來顯示隱藏內容的滑塊。它可以在這個頁面上的視頻http://www.thesun.net/FallOkanaganWineFestivals/Indexaspx.aspx的視頻下面看到。一切正常,但我希望隱藏的內容在鼠標移出新內容區域之前保持可見狀態,而不僅僅是圖像上的熱點。讓jquery滑塊內容保持可見狀態,直到(新內容的)鼠標移出

我已經包含了下面的代碼,非常感謝任何幫助。

<div style="margin-left:10px;"> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_01.jpg);" id="feature1img">&nbsp;</div> 
<div style="width: 880px; height: 235px; display: none; background-color: #333; padding:10px;" id="feature1text"><h3>BC Wine Awards Reception & Tasting</h3> 
<p>Join us for this rare treat event which kicks off our 2011 Fall Okanagan Wine Festival. This event will include the announcement of the award winning wines from our 2011 Fall Judging Competition. This medal winning wines competition sponsored by Richards Packaging, Meyers Norris Penny, Farm Credit Canada and Container World is judged by world renowned judges judging the wines produced by our member wineries. The announcement will be followed by a reception including fabulous tapas and canapés and the opportunity to be one of the few to taste a selection of some of these award-winning wines while you still can. Many winemakers and wineries will be in attendance, so this is also a great chance to meet the award winners themselves. Judging website www.OkanaganWineAwards.com tickets: selectyourtickets.com 250.717.5304</p> 
<h4>Cost:</h4> 
<p>$50.00(all incl)</p> 
<h4>Location</h4> 
<p>The Rotary Centre for the Arts<br /> 
421 Cawston Ave.<br /> 
Kelowna, BC V1Y 6Z1 Canada</p> 
</div> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_02.jpg);" id="feature2img">&nbsp;</div> 
<div style="width: 880px; height: 235px; display: none; background-color: #333; padding:10px;" id="feature2text"> 
<h3>WestJet Wine Tastings</h3> 
<p>Sip! Sample! Spit! Join the WestJet team and explore some This event is for those who want to explore some of the finest wines that are being produced right here in Okanagan Wine Country. A great event for those trying wines for the first time as well as those who want to expand their wine knowledge. There are over 40 wineries present and over 150 wines to sample. Ticket includes: souvenir wine glass, all your wine tasting, bread and cheese, a free taxi ride home and the wonderful fun culture of WestJet airlines. This event always sells out buy your tickets early!! This is a get home safe event, sponsored by BC Liquor Stores and the Johnston Meier Insurance Group. Tickets at: selectyourtickets.com or 250.717.5304</p> 
<h4>Cost:</h4> 
<p>$65.00(all incl)</p> 
<h4>Location</h4> 
<p>The Rotary Centre for the Arts<br /> 
421 Cawston Ave.<br /> 
Kelowna, BC V1Y 6Z1 Canada</p> 
</div> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_03.jpg);" id="feature3img">&nbsp;</div> 
<div style="width: 880px; height: 235px; display: none; background-color: #333; padding:10px;" id="feature3text"> 
<h3>WestJet Wine Tastings</h3> 
<p>Sip! Sample! Spit! Join the WestJet team and explore some This event is for those who want to explore some of the finest wines that are being produced right here in Okanagan Wine Country. A great event for those trying wines for the first time as well as those who want to expand their wine knowledge. There are over 40 wineries present and over 150 wines to sample. Ticket includes: souvenir wine glass, all your wine tasting, bread and cheese, a free taxi ride home and the wonderful fun culture of WestJet airlines. This event always sells out buy your tickets early!! This is a get home safe event, sponsored by BC Liquor Stores and the Johnston Meier Insurance Group. Tickets at: selectyourtickets.com or 250.717.5304</p> 
<h4>Cost:</h4> 
<p>$65.00(all incl)</p> 
<h4>Location</h4> 
<p>The Rotary Centre for the Arts<br /> 
421 Cawston Ave.<br /> 
Kelowna, BC V1Y 6Z1 Canada</p> 

</div> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_04.jpg);" id="feature4img">&nbsp;</div> 
<div style="width: 880px; height: 235px; display: none; background-color: #333; padding:10px;" id="feature4text"> 
<h3>FortisBC Salute To Food and Wine</h3> 
<p>FortisBC presents an exciting new evening that will showcase the region's leading culinary talents and great Okanagan wines. The venue could not be any better – The Wild Apple Restaurant at Manteo Waterfront Resort in Kelowna. Join Chef Bernard from the Wild Apple, Mathew Batey from Mission Hill Family Estate and two other guest chefs as they prepare local cuisine in small plates paired with some of the most storied wineries in the Okanagan. Each chef will also conduct a live cooking demonstration using natural gas and patrons get to take home the chef's recipes. Inspired food, innovative wines, and spectacular views make this event a wonderful time for friends to celebrate together. This is a get home safe event, sponsored by BC Liquor Stores and the Johnston Meier Insurance Group. Tickets online at: selectyourtickets.com</p> 
<h4>Cost:</h4> 
<p>$85.00(all incl)</p> 
<h4>Location</h4> 
<p>Manteo Resort<br /> 
3762 Lakeshore Rd<br /> 
Kelowna, BC Canada</p> 

</div> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_05.jpg);" id="feature5img">&nbsp;</div> 
<div style="width: 880px; height:235px; display: none; background-color: #333; padding:10px;" id="feature5text"> 
<h3>All You Need Is Cheese & Wine – The Seminar</h3> 
<p>Imagine the sensory experience of the beautiful colors of autumn in the Okanagan. Join us to utilize your senses to enjoy a pairing of unique Canadian cheeses with some of the finer white and red wines of the region. Hosted by Dairy Farmers of Canada, this event features dedicated pairings that will be memorable. Nostrala, Boerenkaas, Tiger Blue and Rathtrevor are some of the cheeses you will learn about in the seminar. Although informal, it is presented by a cheese expert and wine educator. This event will definitely improve your knowledge of these fine Canadian products. We look forward to having a wonderful evening with you.</p> 
<h4>Cost:</h4> 
<p>$45.00(all incl)</p> 
<h4>Location</h4> 
<p>Manteo Resort<br /> 
3762 Lakeshore Rd<br /> 
Kelowna, BC Canada</p> 
</div> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_06.jpg);" id="feature6img">&nbsp;</div> 
<div style="width: 880px; height: 235px; display: none; background-color: #333; padding:10px;" id="feature6text"> 
<h3>Battle of the Wine Experts</h3> 
<p>For you wine lovers and those who have an insatiable curiousity, welcome to our first ever panel of wine experts who will argue, debate and perhaps throw grapes at each other as they debate the merits of Meritage in the Okanagan. You will get to taste and compare 6 different Red Meritage wines from the Okanagan, ask questions of the panel as they offer their opinions of the development of this wonderful red blend that has become a successful brand for Okanagan wineries worldwide. And the setting for learning and talking could not be better. The Mary Irwin Theatre at the Rotary Centre for the Arts will allow you to sit back and relax while you taste the wines at the same time as the panel. After the panel discussion, we will close the event with a food and wine reception to allow all panellists and guest to network and exchange their favourite stories.</p> 
<h4>Cost:</h4> 
<p>$50.00(all incl)</p> 
<h4>Location</h4> 
<p>The Rotary Centre for the Arts<br /> 
421 Cawston Ave.<br /> 
Kelowna, BC V1Y 6Z1 Canada</p> 
</div> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_07.jpg);" id="feature7img">&nbsp;</div> 
<div style="width: 880px; height: 235px; display: none; background-color: #333; padding:10px;" id="feature7text"><h3>All You Need Is Cheese…. and some Wine!</h3> 
<p>Cheese lovers rejoice! Sure to please any cheese lover; join Dairy Farmers of Canada and Okanagan Wineries as you walk about the Okanagan Heritage Museum visiting our cheese and wine stations. Guests will enjoy Canadian cheeses paired with fabulous wines. This event will be fun, relaxing, educational and guaranteed to have you leaving with a shopping list of your new favourite cheeses. This is a get home safe event, sponsored by BC Liquor Stores and the Johnston Meier Insurance Group. Tickets available at selectyourtickets.com or 250.717.5304.</p> 
<h4>Cost:</h4> 
<p>$55.00(all incl)</p> 
<h4>Location</h4> 
<p>Watermark Beach Resort<br /> 
15 Park Place<br /> 
Osoyoos, BC V0H1V0 </p> 
</div> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_08.jpg);" id="feature8img">&nbsp;</div> 
<div style="width: 880px; height: 235px; display: none; background-color: #333; padding:10px;" id="feature8text"> 
<h3>Alexis de Portneuf presents "The Young Chefs"</h3> 
<p>Never before has this been done! Alexis de Portneuf is challenging nine BC Interior young Chefs to get creative. The challenge is to create an appetizer, main or dessert course using cheese. Guests will sample these creations and will vote for their favourite. The Okanagan Chefs Association will also select the winner of the Saputo Top Young Chef Award. Join us as we see the best young culinary talent in action. This is a get home safe event, sponsored by BC Liquor Stores and the Johnston Meier Insurance Group. Tickets at: selectyourtickets.com or 250.717.5304</p> 
<h4>Cost:</h4> 
<p>$55.00(all incl)</p> 
<h4>Location</h4> 
<p>Culinary Arts Centre at Okanagan College<br /> 
1000 KLO Road<br /> 
Kelowna, BC V1Y2A7 Canada</p> 
</div> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_09.jpg);" id="feature9img">&nbsp;</div> 
<div style="width: 880px; height: 235px; display: none; background-color: #333; padding:10px;" id="feature9text"> 
<h3>Valley First Grand Finale Consumer Tastings</h3> 
<p>Valley First brings you the oldest and largest event of the fall wine festival. This is a wine tour under one roof!!! Sip! Sample! Spit? Dance? This event is for those who want to explore some of the finest wines that are being produced right here in our back yards. A great event for those trying wines for the first time as well as those who want to expand their wine knowledge. There are over 60 wineries present and over 240 wines to sample. Ticket includes: enjoyable live entertainment, souvenir wine glass, all your wine tasting, bread and cheese and a free taxi ride home. This is a get home safe event, sponsored by BC Liquor Stores and the Johnston Meier Insurance Group. Tickets at valleyfirsttix.com or 877.763.2849</p> 
<h4>Cost:</h4> 
<p>$62.00(all incl)</p> 
<h4>Location</h4> 
<p>Penticton Trade & Convention Centre<br /> 
273 Power St<br /> 
Penticton, BC </p> 
</div> 
<div style="width: 900px; height: 50px; background-image: url(http://www.thesun.net/Pics/Promo/okwine/featuredevents_10.jpg);" id="feature10img">&nbsp;</div> 
<div style="width: 880px; height: 235px; display: none; background-color: #333; padding:10px;" id="feature10text"> 
<h3>Valley First Grand Finale Consumer Tastings</h3> 
<p>Valley First brings you the oldest and largest event of the fall wine festival. This is a wine tour under one roof!!! Sip! Sample! Spit? Dance? This event is for those who want to explore some of the finest wines that are being produced right here in our back yards. A great event for those trying wines for the first time as well as those who want to expand their wine knowledge. There are over 60 wineries present and over 240 wines to sample. Ticket includes: enjoyable live entertainment, souvenir wine glass, all your wine tasting, bread and cheese and a free taxi ride home. This is a get home safe event, sponsored by BC Liquor Stores and the Johnston Meier Insurance Group. Tickets at valleyfirsttix.com or 877.763.2849</p> 
<h4>Cost:</h4> 
<p>$62.00(all incl)</p> 
<h4>Location</h4> 
<p>Penticton Trade & Convention Centre<br /> 
273 Power St<br /> 
Penticton, BC </p> 
</div> 
<div> 
<script type="text/javascript"><!-- 
$("#feature1img").mouseover(function() { 
    $("#feature1text").clearQueue(); 
    $("#feature1text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature1text").mouseout().slideUp("slow"); 
    }); 

$("#feature2img").mouseover(function() { 
    $("#feature2text").clearQueue(); 
    $("#feature2text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature2text").mouseout().slideUp("slow"); 
    }); 

$("#feature3img").mouseover(function() { 
    $("#feature3text").clearQueue(); 
    $("#feature3text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature3text").mouseout().slideUp("slow"); 
    }); 

$("#feature4img").mouseover(function() { 
    $("#feature4text").clearQueue(); 
    $("#feature4text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature4text").mouseout().slideUp("slow"); 
    }); 
    $("#feature5img").mouseover(function() { 
    $("#feature5text").clearQueue(); 
    $("#feature5text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature5text").mouseout().slideUp("slow"); 
    }); 
    $("#feature6img").mouseover(function() { 
    $("#feature6text").clearQueue(); 
    $("#feature6text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature6text").mouseout().slideUp("slow"); 
    }); 
    $("#feature7img").mouseover(function() { 
    $("#feature7text").clearQueue(); 
    $("#feature7text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature7text").mouseout().slideUp("slow"); 
    }); 
    $("#feature8img").mouseover(function() { 
    $("#feature8text").clearQueue(); 
    $("#feature8text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature8text").mouseout().slideUp("slow"); 
    }); 
    $("#feature9img").mouseover(function() { 
    $("#feature9text").clearQueue(); 
    $("#feature9text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature9text").mouseout().slideUp("slow"); 
    }); 
    $("#feature10img").mouseover(function() { 
    $("#feature10text").clearQueue(); 
    $("#feature10text").slideDown("slow"); 
    }).mouseout(function(){ 
    $("#feature10text").mouseout().slideUp("slow"); 
    }); 
// --></script> 
</div> 
</div> 

感謝, ķ

+0

哎呀......你應該考慮把 「特徵」 圖片和文字類,所以你沒有爲每個添加的項目添加五十行jQuery ... – element119

回答

0

我有哪些使用事件的一些更好的運氣變化。

http://jsfiddle.net/CESzM/1/

HTML

<div class='wrapper'> 
    <div id="feature1img">&nbsp;</div> 
    <div class="featureText"><h3>BC Wine Awards Reception & Tasting</h3> 
     <p>Join us for this rare treat event which kicks off our 2011 Fall Okanagan Wine Festival. This event will include the announcement of the award winning wines from our 2011 Fall Judging Competition. This medal winning wines competition sponsored by Richards Packaging, Meyers Norris Penny, Farm Credit Canada and Container World is judged by world renowned judges judging the wines produced by our member wineries. The announcement will be followed by a reception including fabulous tapas and canapés and the opportunity to be one of the few to taste a selection of some of these award-winning wines while you still can. Many winemakers and wineries will be in attendance, so this is also a great chance to meet the award winners themselves. Judging website www.OkanaganWineAwards.com tickets: selectyourtickets.com 250.717.5304</p> 
     <h4>Cost:</h4> 
     <p>$50.00(all incl)</p> 
     <h4>Location</h4> 
     <p>The Rotary Centre for the Arts<br /> 
      421 Cawston Ave.<br /> 
      Kelowna, BC V1Y 6Z1 Canada</p> 
     </div> 
     </div> 

CSS

.featureText{width: 880px; height: 235px; display: none; background-color: #333; padding:10px;} 
#feature1img{width: 900px; height: 50px; background-color:black;} 

JS

$(".featureText").hide(); 
$(".wrapper").hover(function() { 
    $(this).find(".featureText").stop(true, true).slideDown("slow"); 
},function() { 
    $(this).find(".featureText").stop(true, true).slideUp("slow"); 
});