| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
9年前发布

jQuery通知栏插件:peekABar

peekABar 可以创建带有很多定制化选项的通知栏 jQuery 插件。 

jQuery通知栏插件:peekABar

Installation

bower install jquery.peekABar --save

Options

html

Use custom HTML as bar text.

Type:String
Default:Your Message Here

autohide

Autohide the bar after it is shown.

Type:Boolean
Default:false

delay

Time (in ms) before the bar is hidden ifautohideistrue.

Type:Number
Default:3000

padding

Add some padding to the bar.

Type:String
Default:1em

backgroundColor

Add a custom background color to the bar.

Type:String
Default:rgb(195, 195, 195)

animation

The way in which the bar reveals itself.

Type:Object
Example:

animation: {      type: 'slide/fade',      duration: 'slow/3000(in ms)'  }

cssClass

Assign a Custom CSS class to the bar. Overrides ALL styles passed as options. For e.g. padding, backgroundColor etc.

Type:String
Default:empty

opacity

Change bar opacity.

Type:Number
Default:1

position

Where should the bar be revealed? Top or bottom of the page?

Type:String
Default:top
Values:top | bottom

closeOnClick

Close the bar by clicking on it.

Type:Boolean
Default:false

Event Methods

onShow

Called after the bar is shown.

onHide

Called after the bar is hidden.

Instance Methods

bar.show()

Show the bar.

bar.hide()

Hide the bar.

Example

Please check out the complete example below:

// Create a bar  var bar = $.peekABar({      html: 'Custom Message',      delay: 2000,      autohide: true,      padding: '2em',      backgroundColor: 'rgb(195, 195, 195)',      animation: {          type: 'fade',          duration: '2000'      },      opacity: '0.8',      cssClass: 'custom-class',      position: 'bottom',      closeOnClick: true      onShow: function() {          console.log('called after bar is shown');      },      onHide: function() {          console.log('called after bar is hidden');      }  });    // Show the bar  bar.show();    // Hide the bar  bar.hide();    // Show the bar with custom HTML  // This call will override the HTML  // set in any previous definitions.  bar.show({      html: 'Overrides all, puny human.'  });

项目主页:http://www.open-open.com/lib/view/home/1439012328848

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1439012328848.html
peekABar jQuery Ajax框架