2012-03-10 28 views
-1

我正在試着製作一座高山滑雪場。如何動態定義href?

我有兩個縮略圖,一個較大但裁剪的頁面上打開大圖像,如果點擊,和一個較小的拇指帶縱橫比變化。

如何配置highslide實際爲拇指帶使用不同的圖像?

例如,這是一個部分

<a href="picture12.jpg" class="highslide" 
     title="Caption from the anchor's title attribute" 
     onclick="return hs.expand(this, config1)"> 
    <img src="picture12.thumb.jpg" alt=""/> 
</a> 

如果我.aspx.cs頁面上定義的href onclick事件不工作?

<a class='highslide' id="thumb1" runat="server" href="" onclick="return hs.expand(this, miniGalleryOptions1)" title="Two cabins" > 
    <asp:Image ID="Image1" runat="server" BorderWidth="2px" /> 
</a> 

aspx.cs

即使我的.cs頁上的定義onclick事件它仍然沒有工作

thumb1.HRef = s1; 

thumb1.Attributes.Add("onclick", "return hs.expand(this, miniGalleryOptions1)"); 

plz幫助米到解決這一問題的概率?

+0

正確地標記此問題,看起來好像和asp.net相關的問題 – 2012-03-10 09:10:22

回答

0

你可以使用jquery,將你的thumb1放到div中並添加onclick jQuery腳本來改變圖像和樣式。

<script type="text/javascript"> 
     $(document).ready(function() { 
      $('#hrefDiv').click(function() { 
      /*change href's and sizes here */ 
     }); 
    }); 
    </script>