2014-03-27 4 views
0

링크가 맴돌 때 메시지를 표시하는 코드가 있습니다. 이것은 tooltipster를 사용하고 페이지로드시 처음에는 정상적으로 작동합니다. 내 문제는 라디오 버튼을 클릭하면 차례로 클래스 tooltipbfile의 텍스트가 원하는대로 변경되지만 텍스트를 다시 클릭하여 클릭하면 해당 호버 기능이 손실 된 것으로 보입니다. 툴팁이 표시되지 않습니다. 마우스 센터 이벤트를 어딘가에 활성화해야합니까? 나는 $(".tooltipbfile").prop('enabled', true);과 같은 코드를 보았지만 아무런 차이가 없다.jQuery mouseover 이벤트 사용

클릭 이벤트 후 마우스 이벤트를 다시 활성화하는 올바른 방법을 누군가에게 보여 주시면 감사하겠습니다. 감사합니다

업데이트 : 툴팁 API 당. $ (". tooltipbfile"). tooltipster ('disable');

jQuery 코드

$(function() { 
$('input:radio').click(function(){ 
    if($(this).val()=='New Intake'){ 
    $("#fileref").hide(); 
    $(".maxbox").show(); 
    $("#INTKAddMoreFileBox").show(); 
    $(".tooltipbfile").text("Help"); 

    }else if($(this).val()=='New Intake Files'){ 
    $("#fileref").show(); 
    $(".maxbox").hide(); 
    $(".tooltipbfile").text("Some text here.").show(); 
    $("#INTKAddMoreFileBox").hide(); 
    $(".tooltipbfile").tooltipster('disable'); 
    } 

}); 
}); 

Tooltipster 코드

는 페이지로드

<script type="text/javascript"> 
$(document).ready(function() { 
      $('.tooltipbfile').tooltipster({ 
      theme: 'tooltipster-light', 
      position: 'right', 
      animation: 'fade', 
      fixedWidth: 200, 
      maxWidth: 290, 
      content: $('<span>blah blah blah</span>') 
      }); 
     }); 
</script> 

HTML

관련 부분

<div class="fieldset"> 
    <h1><span>Enter Box(es) Reference</span></h1> 
    <p> 
    <a href="#" id="INTKAddMoreFileBox" class="btn btn-info">Add More Boxes</a> 
    <span class="maxbox" style="margin-left:10px;font-size:10px;color: grey;">(Maximum 8)</span> 
    <!--<div class="bxhelp"> 
     You now have the ability to input more than 1 box just by clicking the Add More boxes link. Please only enter 1 box reference per box. You can enter up to a maximum of 8 boxes. 
     <a href="javascript:void(0)" class="boxhelpcls">Close</a> 
     </div>--> 
    <div id="INTKInputsWrapper"> 
    <p> 
     <input name="box_add[]" type="text" required="required /> 
     <a href="javascript:void(0)" class="removeclass"></a> 
     <a style="margin-left: 14px;" href="javascript:void(0)" class="tooltipbfile">Help</a> 
    </p> 
    </div> 
    </p> 
</div> 
<div class="fieldset" id="fileref"> 
    <h1><span>Enter File References</span></h1> 
    <p> 
    <a href="javascript:void(0)" id="BFINTKAddMoreFile" class="btn btn-info">Add More Files</a> 
    <span class="fmaxbox" style="margin-left:10px;font-size:10px;color: grey;">(Maximum 8)</span> 
    <!--<div class="fbxhelp"> 
     You now have the ability to input more than 1 file just by clicking the Add More files link. You can enter up to a maximum of 8 files. 
     <a href="javascript:void(0)" class="fboxhelpcls">Close</a> 
     </div>--> 
    <div id="BFINTKInputsWrapper"> 
    <p> 
     <input name="bfile_add[]" id="bfile_add[]" type="text" required="required" /> 
     <a href="javascript:void(0)" class="removeclass"></a> 
     <a style="margin-left: 14px;" href="javascript:void(0)" class="fboxhelp">Help</a> 
    </p> 
    </div> 
    </p> 
</div> 
01에서 제대로 작동 23,516,
+1

문제에 대한 샘플 바이올린 데모를 작성하십시오 – Rex

+0

html을 게시 할 수 있습니까? – francadaval

+0

@Rex는 바이올린을 만들려고했으나 tooltipster 라이브러리에 대한 외부 링크는 없습니다. 감사합니다 – user1532468

답변

0

tooltipbfile로 다시 설정하는 객체를 클릭하면, 단순히 프로그램이 document.ready에서처럼, 그것은에 tooltipster() 호출을 다시 :

.tooltipster({ 
     theme: 'tooltipster-light', 
     position: 'right', 
     animation: 'fade', 
     fixedWidth: 200, 
     maxWidth: 290, 
     content: $('<span>blah blah blah</span>') 
     }); 

내가 사용한 적이 tooltipster하지만,이 작동해야합니다.

+0

정확히 어디에 넣을까요? 이미 페이지로드 상태에 있기 때문에 'New Intake Files'에 대한 클릭 기능에 있어야합니까? 나는 당신의 대답을 따를 것입니다. 감사합니다 – user1532468

+0

FYI Tooltipster에는 다음과 같이 비활성화 할 수있는 옵션이 있습니다 : $ (". tooltipbfile"). tooltipster ('disable'); 너무 작품 :-) 나는 내 코드에 게시 할 수 있습니다. 감사합니다 – user1532468

+0

$ (". tooltipbfile"). 텍스트 ("일부 텍스트는 여기."). show(); - 바로 뒤에 – Blake