Giter VIP home page Giter VIP logo

webui-popover's Introduction

WebUI-Popover

A lightWeight popover plugin with jquery ,enchance the popover plugin of bootstrap with some awesome new features. It works well with bootstrap ,but bootstrap is not necessary!

Browser compatibility: ie8+,Chrome,Safari,Firefox,Opera

Requirement

jquery1.7+

##Features

  • fast,lightweight
  • support more placements
  • auto caculate placement
  • close button in popover
  • multipule popovers in same page
  • different styles
  • support url and iframe
  • support async mode

##Demo WebUI Popover Demo

##Getting Started

####Including it on your page

<link rel="stylesheet" href="jquery.webui-popover.css">
...
<script src="jquery.js"></script>
<script src="jquery.webui-popover.js"></script>

####Use the plugin as follows:

$('a').webuiPopover(options);

####Some Examples:

Create Simplest Popover

$('a').webuiPopover({title:'Title',content:'Content'});

Create Popover by dom element data-* attribute

<a href="#" data-title="Title" data-content="Contents..." data-placement="right"></a>
$('a').webuiPopover();

Create Popover with bottom placement

$('a').webuiPopover({title:'Title',content:'Content',placement:'bottom'});

Create Popover trigged by mouse hover

$('a').webuiPopover({title:'Title',content:'Content',trigger:'hover'});

Create inversed style Popover

$('a').webuiPopover({title:'Title',content:'Content',style:'inverse'});

Create Popover with fixed width and height

$('a').webuiPopover({title:'Title',content:'Content',width:300,height:200});

Create Popover with close button

$('a').webuiPopover({title:'Title',content:'Content',closable:true});

Create Popover with iframe

$('a').webuiPopover({type:'iframe',url:'http://getbootstrap.com'});

Create Popover Async Mode

$('a').webuiPopover({	
						type:'async',
						url:'https://api.github.com/',
						content:function(data){
 							var html = '<ul>';
 							for(var key in data){html+='<li>'+data[key]+'</li>';}
							html+='</ul>';
							return html;
 						});

default options

{
	placement:'auto',//values: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left
	width:'auto',//can be set with  number
	height:'auto',//can be set with  number
	trigger:'click',//values:click,hover
	style:'',//values:'',inverse
	delay:300,//delay time of the popover, works only when trigger is 'hover'
	cache:true,//if cache is set to false,popover will destroy and recreate
	multi:false,//allow other popovers in page at same time
	arrow:true,//show arrow or not
	title:'',//the popover title ,if title is set to empty string,title bar will auto hide
	content:'',//content of the popover,content can be function
	closeable:false,//display close button or not
	padding:true,//content padding
	type:'html',//content type, values:'html','iframe','async'
	url:''//if not empty ,plugin will load content by url
}

webui-popover's People

Contributors

sandywalker avatar

Watchers

jagged avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.