jquery提示外掛程式qtip2使用(全面),jquery提示外掛程式qtip2

來源:互聯網
上載者:User

jquery提示外掛程式qtip2使用(全面),jquery提示外掛程式qtip2
詳情參考:http://qtip2.com
我下載的 庫檔案以及自己總結的資料:連結:http://pan.baidu.com/s/1pJI43Cv密碼:751y
基本用法:(1)只有簡單提示$('#username').qtip({ // Grab some elements to apply the tooltipto   content: {      text: '使用者名稱只能輸入英文字母或者數字'   }});
(2)帶標題的
$('#password').qtip({ // Grabsome elements to apply the tooltip to  content: {      text:'密碼為6-12位元',title:"示範",  }



(3)設定位置
$('#password').qtip({ // Grab some elements to apply the tooltipto   content: {      text: '密碼為6-12位元',title:"示範",   },position:{     my: 'top left',       at: 'bottom center',},style:{       classes: 'qtip-purple',       tip: {                     border:1,           width:50,           height:20       }}});
my:是指三角的位置at:是在提示在組件的相對位置(top 上 bottom下  )( left左 right右center中)兩組配合使用
(4)設定風格
$('#password').qtip({ // Grab someelements to apply the tooltip to   content: {      text: '密碼為6-12位元',title:"示範",   },position:{       my: 'top left',       at: 'bottom center',},style:{     classes: 'qtip-purple',       tip: {                     border:1,           width:50,           height:20       }}}); classes可以有多種選擇
qtip-light淺色qtip-dark 深色
qtip-cream
qtip-red
qtip-blue
qtip-shadow
qtip-rounded圓角
qtip-youtube
qtip-jtools
qtip-cluetip
qtip-tipsy
qtip-tip
qtip-titlebar
qtip-default
 classes:'qtip-purple',


 classes: 'qtip-purpleqtip-rounded',

可以自訂 上面的qtip-purple就是我自己定義的

.qtip-purple{background-color:#9FF0E1;border-color:#EEC933;color:#42B453}.qtip-purple.qtip-titlebar{background-color:#9465E1} 
background-color是內容的背景顏色border-color:整個的邊框color:文字的顏色.qtip-purple.qtip-titlebar{background-color: #9465E1}  設定的是標題的背景色

標題還可以設定標題文字顏色
.qtip-purple .qtip-titlebar{background-color:#9465E1;color:red} 

(6)顯示 隱藏 重設等

  顯示:$('#username').qtip('show');

  隱藏:$('#username').qtip('hide');


$('.selector').qtip('reposition');// Reposition all tooltips belonging to the selected elements重設該選取器選中元素的提示組件

$('.selector').qtip('disable');// Disable all tooltips belonging to the selectedelements

該選取器選中元素的提示組件設為不可用狀態

$('.selector').qtip('toggle',true);// 顯示該選取器選中元素的提示組件$('.selector').qtip('destroy',true);// 直接銷毀屬於該選取器選中元素的提示組件



(7)修改值


$(“#username”).qtip('api').set('content.text','這裡是內容');

 

 

$(“#username”).qtip('api').set('content.text','這裡是修改後的內容')..set('content.title','這裡是修改後的標題');

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.