2012-03-10 4 views
-1

나는 highslide로 갤러리를 만들려고합니다.동적으로 href를 정의하는 방법은 무엇입니까?

두 개의 축소판 이미지가 있습니다. 클릭하면 큰 이미지가 열리는 페이지에는 크고 자른 이미지가 있고, 축소판의 가로 세로 비율이 다른 작은 이미지가 있습니다.

실제로 엄지 스트립에 다른 이미지를 사용하려면 고화질을 어떻게 설정해야합니까?

예를 들어이 내가 .aspx.cs 페이지에서 HREF를 정의하고있는 경우 온 클릭 이벤트가 작동하지 않는 부분

<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> 

입니다.? 내가 .cs 페이지에서 온 클릭 이벤트를 정의하고 경우에도

aspx.cs

<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> 

는 여전히 확률값을 해결하기 위해

thumb1.HRef = s1; 

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

PLZ 도움말 m 작동하지?

+0

이 태그를 올바르게 태그하면이 asp.net 관련 질문 –

답변

0

jquery를 사용하여 thumb1을 div에 넣고 onclick jquery 스크립트를 추가하여 이미지와 스타일을 변경할 수 있습니다.

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