Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 国产精品女上位在线观看,久久成年人视频,日本欧美在线

          整合營銷服務商

          電腦端+手機端+微信端=數據同步管理

          免費咨詢熱線:

          html欄目邊框過渡動畫小效果

          天就來分享一些網頁中會用到的展示的小效果

          很多欄目的邊框當鼠標移上去的時候,邊框會有移動的色澤變化,有順時針過渡或者逆時針過渡的效果

          下面看看效果:

          實現代碼:

          一篇文章我們說了單行文本框和多行文本框,今天呢我們繼續看一下表單的其它控件:單選框、復選框、下拉框。

          (1)單選框和復選框

          在我們表單頁面中,經常會有選擇性別或者選擇愛好這類的內容,使用選擇框是一個好主意,html中有兩種選擇框,即單選框和復選框,兩者的區別是單選框中的選項用戶只能選擇一項,而復選框中用戶可以任意選擇多項,甚至全選。

          使用語法:

          單選框:<input type="radio" value="值" name="名稱" checked="checked"/>

          復選框:<input type="checkbox" value="值" name="名稱" checked="checked"/>

          詳細講解:

          1、type: 當 type="radio" 時,控件為單選框;當 type="checkbox" 時,控件為復選框

          2、value:提交數據到服務器的值(后臺程序使用)

          3、name:為控件命名,這里要注意同一組的單選按鈕,name 取值一定要一致(具體可見下邊的參考練習)。

          4、checked:當設置 checked="checked"(也可以直接簡寫成checked) 時,該選項被默認選中

          使用練習:

          我們創建一個表單,表單里邊包含姓別(男、女)選擇的單選框,默認選中男以及愛好(唱歌、打游戲、繪畫、旅游)選擇的多選框,默認選中唱歌。具體的代碼如下圖所示:

          在網頁中的顯示效果就如下圖所示:

          (2)下拉框

          下拉框也是我們常用的一個表單控件,多用于選擇城市地區等。

          使用語法:

          <select>

          <option value="向服務器提交的內容" selected="selected">網頁顯示的內容</option>

          </select>

          詳細講解:

          1、option:option為select下拉子元素,可以有一個或多個,寫法類似ul和li,其中的value內容為提交數據到服務器的值(后臺程序使用)

          2、selected:當設置 selected="selected"(也可以直接簡寫成selected) 時,該選項被默認選中

          使用練習:

          我們創建一個表單,表單里邊包含一個城市的下拉框,下拉框中有北京、上海、天津這三個城市,其中默認選中天津。具體的代碼如下圖所示:

          在網頁中的顯示效果就如下圖所示:

          好了,本篇文章就先給大家介紹這幾個表單控件的語法以及使用,下篇文章我們將介紹按鈕的語法及使用以及完整的表單練習演示,記得平時要多加練習才是王道。

          每日金句:做人要像竹子一樣每前進一步,都要做一次小結。喜歡我的文章的小伙伴記得關注一下哦,每天將為你更新最新知識。

          sweetalert2是一個漂亮的、響應式、可定制的替代JAVASCRIPT原生的彈出框插件。sweetalert2相比sweetalert更加強大,但它不是sweetalert的擴展,它是一個全新的插件,且支持三大流行前端框架React、Vue、Angular。

          Github和官網

          https://github.com/sweetalert2/sweetalert2

          https://sweetalert2.github.io/

          安裝

          提供了很多安裝方式

          • 使用npm安裝
          npm install --save sweetalert2
          
          • 使用cdn
          <script src="https://cdn.jsdelivr.net/npm/sweetalert2@8"></script>
          

          注意:如果想要兼容IE11,還得引入polyfill.js

          <script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.js"></script>
          

          模塊化用法

          // ES6 Modules or TypeScript
          import Swal from 'sweetalert2'
          // CommonJS
          const Swal = require('sweetalert2')
          

          示例

          • 最基本的信息彈出框
          Swal.fire('基本信息彈框')
          

          • 標題下包含文字
          Swal.fire(
           '標題下有文字',
           '標題下的文字?',
           'question'
           )
          

          • 底部文字
          Swal.fire({
           type: 'error',
           title: '標題',
           text: '出錯啦!',
           footer: '<a href>為什么會出錯?</a>'
           })
          

          • 自定義html
          Swal.fire({
           title: '<strong>HTML <u>示例</u></strong>',
           type: 'info',
           html:
           '你可以使用自定義的html<a ,
           showCloseButton: true,
           showCancelButton: true,
           focusConfirm: false,
           confirmButtonText:
           '好的',
           confirmButtonAriaLabel: '看起來不錯',
           cancelButtonText:
           '取消',
           cancelButtonAriaLabel: '取消',
           })
          

          • 自定義彈框的位置
          Swal.fire({
           position: 'top-end',
           type: 'success',
           title: '你的修改以保存',
           showConfirmButton: false,
           timer: 1500
           })
          

          • 函數回調
          Swal.fire({
           title: '確定要刪除么?',
           text: "刪除后將無法撤銷!",
           type: 'warning',
           showCancelButton: true,
           confirmButtonColor: '#3085d6',
           cancelButtonColor: '#d33',
           confirmButtonText: '確定',
           cancelButtonText:'取消'
           }).then((result) => {
           if (result.value) {
           Swal.fire(
           '刪除成功!',
           '文件已被刪除',
           'success'
           )
           }
           })
          

          • 自定義圖片,禁止動畫
          Swal.fire({
           title: '標題',
           text: '自定義圖片',
           imageUrl: 'https://unsplash.it/400/200',
           imageWidth: 400,
           imageHeight: 200,
           imageAlt: 'Custom image',
           animation: false
           })
          

          • 自定義寬度、邊框和背景
          Swal.fire({
           title: '自定義寬度、邊框和背景',
           width: 600,
           padding: '3em',
           background: '#fff url(/images/trees.png)',
           })
          

          • 自定義關閉(自動關閉)
          let timerInterval
          Swal.fire({
           title: '自動關閉的彈框!',
           html: '我會在<strong></strong> 秒后關閉.',
           timer: 2000,
           onBeforeOpen: () => {
           Swal.showLoading()
           timerInterval = setInterval(() => {
           Swal.getContent().querySelector('strong')
           .textContent = Swal.getTimerLeft()
           }, 100)
           },
           onClose: () => {
           clearInterval(timerInterval)
           }
          }).then((result) => {
           if (
           // Read more about handling dismissals
           result.dismiss === Swal.DismissReason.timer
           ) {
           console.log('I was closed by the timer')
           }
          })
          

          • 異步提交
          Swal.fire({
           title: '提交用戶名',
           input: 'text',
           inputAttributes: {
           autocapitalize: 'off'
           },
           showCancelButton: true,
           confirmButtonText: '提交',
           cancelButtonText: '取消',
           showLoaderOnConfirm: true,
           preConfirm: (login) => {
           return fetch(`//api.github.com/users/${login}`)
           .then(response => {
           if (!response.ok) {
           throw new Error(response.statusText)
           }
           return response.json()
           })
           .catch(error => {
           Swal.showValidationMessage(
           `請求出錯: ${error}`
           )
           })
           },
           allowOutsideClick: () => !Swal.isLoading()
           }).then((result) => {
           if (result.value) {
           Swal.fire({
           title: `${result.value.login}'s avatar`,
           imageUrl: result.value.avatar_url
           })
           }
           })
          

          • 三步曲
          Swal.mixin({
           input: 'text',
           confirmButtonText: '下一步',
           showCancelButton: true,
           cancelButtonText:'取消',
           progressSteps: ['1', '2', '3']
           }).queue([
           {
           title: '問題1',
           text: '使用modal很簡單?'
           },
           '問題2',
           '問題3'
           ]).then((result) => {
           if (result.value) {
           Swal.fire({
           title: '所有問題回答完成!',
           html:
           '你的答案是: <pre><code>' +
           JSON.stringify(result.value) +
           '</code></pre>',
           confirmButtonText: 'Lovely!'
           })
           }
           })
          

          這里就簡單介紹這些示例,更多示例詳見官方文檔

          彈框類型

          • success


          • error


          • warning


          • info


          • question

          相關項目

          • ngx-sweetalert2 - Angular 4+集成

          https://github.com/sweetalert2/ngx-sweetalert2

          • sweetalert2-react-content - React集成

          https://github.com/sweetalert2/sweetalert2-react-content

          • sweetalert2-webpack-demo - webpack demo

          https://github.com/sweetalert2/sweetalert2-webpack-demo

          • sweetalert2-parcel-demo - parcel demo

          https://github.com/sweetalert2/sweetalert2-parcel-demo

          • Vue.js集成(社區維護)

          https://github.com/avil13/vue-sweetalert2

          • Laravel 5 Package(社區維護)

          https://github.com/realrashid/sweet-alert

          瀏覽器兼容性

          總結

          sweetalert2是原本sweetalert的升級版,功能更加強大,文檔更加全面,寫法更加先進,是Web開發中常用的插件,當然同樣優秀的還有很多,比如國產的layer.js也很好用,選擇一個適合自己的就成,今天的介紹就到這里,希望能對你有所幫助,如果還有更好的推薦,歡迎到評論區留言,謝謝!


          主站蜘蛛池模板: 亲子乱AV视频一区二区| 亚洲国产一区二区三区在线观看| 人妻少妇精品一区二区三区| 一区二区在线免费观看| 一区二区免费电影| 亚洲一区精彩视频| 亚洲AV色香蕉一区二区| 亚洲性日韩精品一区二区三区| 亚洲欧洲一区二区三区| 国模吧一区二区三区精品视频| 久久精品国产一区二区三| 亚洲日韩AV一区二区三区中文 | 国产精品女同一区二区 | 中文字幕一区二区视频| 国产亚洲日韩一区二区三区| 精品人体无码一区二区三区 | 久久精品无码一区二区三区| 3d动漫精品啪啪一区二区中文| 成人无码AV一区二区| 精品亚洲一区二区三区在线观看 | 日韩欧国产精品一区综合无码| 人妻无码一区二区三区免费| 久热国产精品视频一区二区三区| 麻豆精品一区二区综合av| 无码人妻精品一区二区三区99仓本 | 亚洲AV日韩综合一区| 国产日产久久高清欧美一区| 国产免费无码一区二区| 无码人妻视频一区二区三区 | 国产成人一区二区三区视频免费 | 国产一区二区三区久久| 国产成人无码一区二区三区| 无码人妻精品一区二区三区在线| 亚洲AV网一区二区三区| 无码国产精品一区二区免费式芒果 | 免费视频精品一区二区三区| 婷婷国产成人精品一区二| 国产日韩精品一区二区三区在线| 国产日韩精品一区二区在线观看播放 | 精彩视频一区二区| 日韩人妻无码一区二区三区综合部|