2017-01-18 6 views

답변

1

더 나은 이해를 위해 질문에 대해 더 자세히 설명해야합니다. loading model

방문이 링크

그 것이다 bpopup

«기본 예제 사용 방법 : 내가 생각 는 귀하의 질문에 여기

링크를 답변을 얻을 것이다 내 특정 링크를 통해 이동 해고 될 때 bPopup을 트리거하는 클릭 이벤트를 바인딩합니다. jQuery core lib (1.3.x 이상) 및 bPopup에 대한 참조를 추가하십시오. bPopup에 링크하여하지 마십시오 :

<script src="http://ajax.googleapis.com/ajax/libs/jquery/x.x.x/jquery.min.js"></script> 
    <script src="jquery.bpopup-x.x.x.min.js"></script> 

마크 업 : 팝업 버튼 + 요소를 추가합니다.

<html> 
     <head> ... </head> 
     <body> 
      ... 
      <!-- Button that triggers the popup --> 
      <button id="my-button">POP IT UP</button> 
      <!-- Element to pop up --> 
      <div id="element_to_pop_up">Content of popup</div> 
      ... 
     </body> 
    </html> 

CSS : 당신은 페이지로드에 팝업 할 요소를 숨 깁니다.

<style> 
#element_to_pop_up { display:none; } 
</style> 

마법 : 팝업을 트리거 버튼을 클릭 이벤트를 바인딩. 데모 Link here

+0

를 들어

// Semicolon (;) to ensure closing of earlier scripting // Encapsulation // $ is assigned to jQuery ;(function($) { // DOM Ready $(function() { // Binding a click event // From jQuery v.1.7.0 use .on() instead of .bind() $('#my-button').bind('click', function(e) { // Prevents the default action to be triggered. e.preventDefault(); // Triggering bPopup when click event is fired $('#element_to_pop_up').bPopup(); }); }); })(jQuery); 

또는

;(function($) { $(function() { $('#my-button').bind('click', function(e) { e.preventDefault(); $('#element_to_pop_up').bPopup({ appendTo: 'form' , zIndex: 2 , modalClose: false }); }); }); })(jQuery); 

링크이 코멘트가 아닌 해답이 될 것이다. –

+0

@RoryMcCrossan 코드를 작성하고 있습니다. 하지만 잘못 표시했다. –

+0

무슨 뜻인지 모르겠다. –

관련 문제