2010-02-01 1 views
2

나는이 수업을

<h2 class="care-home-fees"><a title="Care Home Fees" href="#">Text</a></h2> 

을 페이드 아웃 및 두 개의 분리 된 이미지

가 여기에

내입니다있는이

<h2 class="care-home-fees-over"><a title="Care Home Fees" href="#">Text</a></h2> 

공지 사항에 페이드 수 있도록하고 싶습니다 작동하지 않는 현재 마크 업

$(document).ready(function(){ 

$("h2.care-home-fees").hover( 
    function() { 
    $(this).addClass("care-home-fees-over"); 
    }, 
    function() { 
    $(this).removeClass("care-home-fees"); 
    } 
); 

}); 

및 변경하기 전에 인쇄 버튼을

<h2 class="care-home-fees"><a title="Care Home Fees" href="#">Text</a></h2> 
+0

"두 개의 개별 이미지가 있음을 유의하십시오." 무슨 이미지 요? –

+0

당신은 페이드 ..를 사용하지 않습니다 ..! – jjj

답변

2

당신은 .animate() 대신 .addClass() 또는 .removeClass() 할 수 있습니다.

CSS 클래스로 수행하려는 작업은 JQuery UI에 있습니다.

http://api.jquery.com/animate/

+0

도움을 주셔서 감사합니다. 클래스간에 애니메이션을 적용하려면 어떻게해야합니까? – Andy

+1

여기를 참조하십시오. http://74.125.95.132/search?q=cache:SRanyKoRtxsJ:jqueryui.com/docs/Effects/Methods+jquery+ui+animate+between+classes&cd=1&hl=ko&ct=clnk&gl=us&client=firefox-a 실제 사이트가 다운되었습니다 : ( –

0

이를 위해 jQuery를 UI를 사용해야합니다. 설명서 (here)로 안내 하겠지만 현재로서는 문제가있는 것 같습니다. 여기에 언급 된 addClassremoveClass 메서드를 사용하고 싶을 것입니다 (기본 jQuery 객체는 아닙니다).

편집 : 다니엘의 링크를 참조하십시오!

+0

입력 해 주셔서 감사합니다. – Andy

0

먼저 JQuery와 내가 jquery-1.3.2.min.js이 를 다운로드해야하지만 최종 릴리스 jQuery 1.4.1

변화를 원하는 경우 <h2 class="care-home-fees"><a title="Care Home Fees" href="#">Text</a></h2>

<h2 class="care-home-fees"><a id="j" title="Care Home Fees" href="#">Text</a></h2> 

에 당신은 당신의 HTML에서 JQuery와 파일을 추가 할 필요가 ... 아래에 추가 한대로 :

//this is the start of the head 
<head runat="server"> 
    <title></title> 
// i added jquery-1.3.2.min.js file here 
    <script src="jquery-1.3.2.min.js" type="text/javascript"></script> 

<script> 
    $("h2").click(function() { 
    $(document.getElementById('j')).fadeOut("slow"); 
$("a:hidden:first").fadeIn("slow"); 
    }); 
    </script> 

//this is the end of the head 
</head> 

나는 그것이 작동하기를 바랍니다.

+0

감사합니다. jjj가 어떻게 돌아가고 다시 당신에게 돌아갈 지 확인하십시오. – Andy

+0

아무런 작업을하지 않아도 페이지의 다른 링크가 다시 페이드 아웃됩니다. – Andy

+0

" 케어 홈 요금 "visible = false – jjj

0
$(document).ready(function(){ 

     $('#wm').hover(function(){ 
      $('#wm .bld').stop().fadeTo(300, 0); 
     }, function(){ 
      $('#wm .bld').stop().fadeTo(300, 1); 
     }); 

     $('#ch').hover(function(){ 
      $('#ch .bld').stop().fadeTo(300, 0); 
     }, function(){ 
      $('#ch .bld').stop().fadeTo(300, 1); 
     }); 
});