Tipso – 輕巧的jQuery提示框外掛程式

來源:互聯網
上載者:User

標籤:web   on()   背景顏色   offsetx   body   jquer   nbsp   href   lin   

Tooltip(提示框)是一種常見的效果,它通常用在需要進一步解釋、說明或提示的某個詞上。這種小效果實現起來雖然不難,但如果你想不勞而獲,可以試試 Tipso。

Tipso 基於 jQuery,提供了很多配置,如:

  • 顯示動畫期間
  • 背景顏色
  • 文本顏色
  • 顯示位置(上/右/下/左)
  • 寬度
  • 位移
  • 載入 ajax 內容
  • 回呼函數
使用方法1、引入檔案
<link rel="stylesheet" href="css/tipso.css"><script src="js/jquery.js"></script><script src="js/tipso.js"></script>
2、HTML
<span id="tip" data-tipso="dowebok">Tipso</span>

或者:

<span id="tip" title="內容來自 title 屬性">Tipso</span>

使用屬性 data-tipso 的值作為 tip 的內容是時,需要設定 useTitle: false;使用 title 屬性作為 tip 的內容則設定 useTitle: true 或省略此參數。

3、JavaScript
$(function() {    $(‘#tip‘).tipso({        useTitle: false    });});
配置

屬性/方法 類型 預設值 說明
speed 整數 400 動畫期間
background 字串 ‘#55b555’ 背景顏色
color 字串 ‘#ffffff’ 文本顏色
position 字串 ‘top’ 顯示位置
width 整數 200 寬度
delay 整數 200 延遲
offsetX 整數 0 水平位移
offsetY 整數 0 垂直位移
content 字串 null 內容
ajaxContentUrl 字串 null 非同步載入內容
useTitle 布爾值 true 使用 title 屬性值作為內容
onBeforeShow 函數 null 執行前的回呼函數
onShow 函數 null 顯示前的回呼函數
onHide 函數 null 顯示後的回呼函數

Tipso – 輕巧的jQuery提示框外掛程式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.