2015-04-25 28 views
-1

在Google上對彈出腳本進行的簡單搜索可以爲彈出式插件帶來數以千計的結果..但我相信這種簡單的應用需要一個插件。簡單的jQuery彈出式菜單,只需點擊一個按鈕即可打開並關閉點擊一個十字鍵

我想,沒有覆蓋,做基本的三件事一個簡單的彈出腳本:

  1. 上的按鈕
  2. 關閉上的橫
  3. 的點擊的點擊開度爲中心的屏幕,並且被固定

    <div class="member-pop" id="member-pop1"> 
    
        <a class="member-close1 cross"><img src="img/pop/pop-cross.png" 
        alt="Close" /></a> <! -- This will close Popup --> 
    
    <p>Content inside popup</p> 
    
    </div> 
    

我做了什麼至今

$('.pop-member1').click(function() { 
      $('#member-pop1').show(); 
     }); 
     $('.cross').click(function() { 
      $(this).parent().hide(); 
     }); 

這實現了1和2號3仍未達到

回答

0
$("#member-pop1").dialog(); 

<div id="member-pop1" title="My dialog"> 
    <p>This is where you show the content. Click on cross to close me!</p> 
</div> 

利用jQuery UI的對話框。

相關問題