2010-01-06 125 views

回答

0

我強烈推薦SerialScroll插件here是一個演示,文檔可以找到here

我用這個插件和一些簡單的html創建了一個非常酷的圖像滑塊。以下是我使用的代碼和HTML。

<div id="featProd_container"> 
    <span id="previous" class="disable">&nbsp;</span> 
    <span id="next" class="step">&nbsp;</span> 

<%-- <div id="featProd_maskOver"></div>--%> 
    <div id="featProd_mask"> 
     <asp:ListView ID="lvFeatured" runat="server" GroupItemCount="2"> 
      <LayoutTemplate> 
       <div id="featProd_scroll"> 
        <div id="groupPlaceholder" runat="server" /> 
       </div> 
      </LayoutTemplate> 
      <GroupTemplate> 
       <div class="itemSet"> 
        <div id="itemPlaceholder" runat="server" /> 
       </div> 
      </GroupTemplate> 
      <GroupSeparatorTemplate></GroupSeparatorTemplate> 
      <ItemTemplate> 
       <div class="item"> 
        <a href='<%# ((string)Eval("DetailUrl")).Replace("~", "") %>'><img src='<%# Eval("SliderImageUrl") %>' /></a> 
        <div class="itemInfo"> 
         <h3><a href='<%# ((string)Eval("DetailUrl")).Replace("~", "") %>' style="color:Black;"><%# Eval("DisplayName") %></a> </h3> 
         <span><%# Eval("ProductId")%></span> 
        </div> 
       </div>   
      </ItemTemplate>  
     </asp:ListView> 
    </div> 
    <div id="jumpLinkContainer" style="display: table; margin:0 auto;"> 
     <ul id="featProd_control" style="width: 70px;"> 
      <asp:PlaceHolder ID="phJumpLinks" runat="server" /> 
     </ul> 
    </div> 
</div> 

只需開啓下面的腳本調用,並配置行爲和導航元素選擇器。

<script type="text/javascript"> 
    $(document).ready(function() { loadFeaturedProducts(); }); 

    function loadFeaturedProducts() { 

     $('.item > a, .itemInfo > h3 > a').click(function() { var link = $(this).attr('href'); if (link) { document.location.href = link; } }); 

     $('#featProd_container > #featProd_mask').serialScroll({ 
      items: '#featProd_scroll > .itemSet', 
      prev: '#featProd_container > #previous', 
      next: '#featProd_container > #next', 
      //offset: -230, //when scrolling to photo, stop 230 before reaching it (from the left) 
      start: 0, //as we are centering it, start at the 2nd 
      duration: 700, 
      force: true, 
      stop: true, 
      lock: false, 
      cycle: false, //don't pull back once you reach the end 
      easing: 'easeOutQuart', //use this easing equation for a funny effect 
      jump: true, //click on the images to scroll to them 
      navigation: '#featProd_container > #jumpLinkContainer > #featProd_control > li', 
      onBefore: function(e, elem, $pane, $items, pos) { 

       var nav = $('#featProd_container > #jumpLinkContainer > #featProd_control > li'); 
       nav.removeClass("active"); nav.eq(pos).toggleClass("active"); 

       if ($items) { 
        var jq = $('#featProd_container > #next, #featProd_container > #previous').removeClass("disable"); 
        if (pos == 0) 
         $('#featProd_container > #previous').toggleClass("disable"); 
        else if (pos == ($items.length - 1)) 
         $('#featProd_container > #next').toggleClass("disable"); 

       } 
      } 
     }); 
    } 
</script> 
0

我發表了一篇博客貼子,建立,做一些非常相似的幻燈片區域。這裏是鏈接:

http://blog.bobcravens.com/2009/12/27/BuildingAWebAppSlideShowArea.aspx

這將需要一點修改。例如,我有幾個小號框表示當前的照片。這些需要修改才能在您的示例網站上顯示菜單。

希望這會給你足夠的信息開始。

下面是此幻燈片演示的一個演示。

http://bobcravens.com/hfs_dev/

請注意,這是我的dev分段區域,但不保證長壽命。它將在那裏至少幾個星期。隨時訪問,而它持續。