国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

angular.js - ng-show 表達式動態顯示

瀏覽:145日期:2024-09-30 14:07:39

問題描述

form input輸入框點擊搜索框顯示提示內容,點擊其他地方,提示內容消失

代碼見下

<form name='checkForm'> <p class='form-group'><label class='col-sm-3 control-label'>用 戶 名</label><p class='col-sm-8 account'> <input type='text' placeholder='您的賬戶名和登錄名'ng-model='account'name='account'required='required'ng-pattern='regularList.account'ng-blur='checkForm.account.$blured = true;'ng-focus='checkForm.account.$blured = false;'autocomplete='off'/> <span ng-class='{’right’:(checkForm.account.$error.pattern),’error’:checkForm.account.$valid}'></span></p> </p> <p ng-show='checkForm.account.$blured'><p class='input-tip'> <i></i> <span>!支持中文、字母、數字、“-”“_”的組合,4-20個字符</span></p> </p></form>

具體效果見下angular.js - ng-show 表達式動態顯示

當我點擊搜索框時,提示內容顯示angular.js - ng-show 表達式動態顯示

求指導,謝謝

問題解答

回答1:

ng-blur和ng-focus的表達式寫反了吧?還有變量里邊有必要加入$blured么?隨便一個變量都能標記是否獲得焦點吧,你再看看。

相關文章:
主站蜘蛛池模板: 临沂市| 兴业县| 麻江县| 吕梁市| 孝义市| 鲁山县| 惠来县| 巫溪县| 长春市| 永清县| 靖边县| 九江市| 睢宁县| 教育| 桂东县| 黑山县| 玉门市| 呼伦贝尔市| 泾川县| 上虞市| 赤水市| 肇州县| 安达市| 上虞市| 江门市| 姜堰市| 康马县| 浏阳市| 湘西| 大丰市| 类乌齐县| 丹巴县| 法库县| 桐城市| 大英县| 兴安县| 刚察县| 罗平县| 拉萨市| 太湖县| 运城市|