2011-10-18 66 views
0

當我點擊下面的代碼彈出按鈕應該來。我需要創建一個彈出窗口詢問你是新客戶還是現有客戶,當我點擊按鈕時,我該如何繼續這樣做。應該感謝幫助。我想創建一個彈出窗口,當我點擊按鈕使用Jquery

<a style="display: inline-block; width: 85px; font-weight: normal;" href="javascript:__doPostBack('mrpPhones$ctl06$lineItemPrice$lnkbtnAddToCart','')" class="button-genericsprite green-button-23cart" title="Add to cart" id="mrpPhones_ctl06_lineItemPrice_lnkbtnAddToCart" onclick="javascript:hideProgressBar();return openPlanChangeRequiredPopup('cd244ed6-7afc-4db5-bf764b7de21c9003','https://s.tmocache.com/images/png/products/phones/LG_Optimus_T_Black/110x110.png');"> 
    <span style="font-size: 12px;">Add to Cart</span> 
</a> 
+2

你爲什麼把你的代碼複製到註釋中?它弄亂了頁面的風水 – Clive

+0

你是什麼意思的「彈出」?模態對話框?警報?一個窗口? –

回答

0

我認爲你需要像這樣

<script> 
$(function() { 
    $("#dialog-confirm").dialog({ 
     resizable: false, 
     height:140, 
     modal: true, 
     buttons: { 
      "New Customer": function() { 
            //Put Necessary codes here 
       $(this).dialog("close"); 
      }, 
      "Existing customer": function() { 
            //Put Necessary codes here 
       $(this).dialog("close"); 
      } 
     } 
    }); 
}); 
</script> 

HTML:

<div id="dialog-confirm" title="New or Existing Customer?"> 
<p> 
    <span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 
    0;">New or Existing Customer? 
    </span> 
</p> 
</div> 
相關問題