jQuery創(chuàng)建注冊(cè)對(duì)話框

學(xué)習(xí)要點(diǎn)

  • HTML部分
  • CSS部分
  • jQuery部分

(一) HTML部分

<!--表單區(qū)-->
<div id="dialog" title="會(huì)員注冊(cè)">
    <p>
        <label for="user">賬號(hào):</label>
        <input type="text" name="user" class="text" id="user" title="請(qǐng)輸入賬號(hào),不小于2位!">
        <span class="star"> * </span>
    </p>
    <p>
        <label for="password">密碼:</label>
        <input type="password" name="password" class="text" id="password" title="請(qǐng)輸入密碼,位數(shù)不能小于6位!">
        <span class="star"> * </span>
    </p>
     <p>
         <label for="email">郵箱:</label>
         <input type="text"name="email" class="text" id="email" title="請(qǐng)輸入電子郵件!">
         <span class="star"> * </span>
     </p>
     <p>
         <label for="">性別</label>
         <input type="radio" name="sex" id="male" checked="checked"><label for="male">男</label>
         <input type="radio" name="sex" id="female"><label for="female">女</label>
     </p>
    <p>
        <label for="date">生日:</label>
        <input type="text" name="date" readonly="readonly" class="text" id="date">
    </p>
       <p>
        <select name="city" id="city2">
            <option value="天津">天津</option>
            <option value="北京">北京</option>
            <option value="石家莊">石家莊</option>
        </select>
    </p>
</div>
<!--表單區(qū)結(jié)束-->

(二) css部分

#dialog{padding:15px;}
#dialog p{margin:10px 0;padding:0;}
#dialog p label{font-size:14px;color:#666;}
#dialog p .star{color:red;}
#dialog.text{border-radius:4px;border:1px solid #ccc;background:#fff;height:25px;width:200px;text-indent:5px;color:#666;}

(三) jquery部分

       //dialog樣式
         $("#dialog").dialog({
               title:"這個(gè)就是注冊(cè)的對(duì)話框",
               width:600,
               height:600,
               minWidth:400,
               minHeight:400,
               autoOpen:false,
               draggable:false,
               //position:"center center",
               show:true,
               hide:true,
               resizable:false,
               modal:true,
               closeText:"關(guān)閉",
               buttons:{
                   "提交":function(){window.alert("提交")},
                   "保存":function(){window.alert("關(guān)閉")}
               }
         })
        //點(diǎn)擊后彈出來(lái)對(duì)話框
        $("#dialog").buttonset();
        $("#date").datepicker();
        $("#dialog input[title]").tooltip();
       //下拉框
    $("#city2").on('selectmenuchange', function (e,ui){
              console.log(ui.item.value);
          })
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 一、樣式篇 第1章 初識(shí)jQuery (1)環(huán)境搭建 進(jìn)入官方網(wǎng)站獲取最新的版本 http://jquery.co...
    凜0_0閱讀 3,672評(píng)論 0 44
  • 原文鏈接 http://blog.poetries.top/2016/10/20/review-jQuery 關(guān)注...
    前端進(jìn)階之旅閱讀 16,944評(píng)論 18 503
  • 為甚嚒要學(xué)習(xí)jQuery? 因?yàn)镴S中有很多痛點(diǎn): window.onload事件只能出現(xiàn)一次,如果出現(xiàn)多次,后面...
    magic_pill閱讀 895評(píng)論 0 13
  • 通過(guò)jQuery,您可以選?。ú樵?,query)HTML元素,并對(duì)它們執(zhí)行“操作”(actions)。 jQuer...
    枇杷樹(shù)8824閱讀 724評(píng)論 0 3
  • 《圍城》 天下只有兩種人。比如一串葡萄到手,一種人挑最好的先吃,另一種人把最好的留到最后吃。照例第一種人應(yīng)該樂(lè)觀,...
    跳小熊舞的哆啦閱讀 2,235評(píng)論 0 0

友情鏈接更多精彩內(nèi)容