O noso complemento Modal é unha versión súper delgada do complemento modal js tradicional, tendo especial coidado en incluír só a funcionalidade que necesitamos aquí en Twitter.
Descargar
- $ ( '#meu-modal' ). modal ( opcións )
Nome | tipo | por defecto | descrición |
---|---|---|---|
pano de fondo | booleano, cadea | falso | Inclúe un elemento de fondo modal. Establece o fondo como "static" se non queres que o modal se peche cando se fai clic no fondo. |
teclado | booleano | falso | Pecha o modal cando se preme a tecla Esc |
mostrar | booleano | falso | Abre modal na inicialización da clase |
Podes activar os modais na túa páxina facilmente sen ter que escribir unha soa liña de javascript. Só ten que dar a un elemento un data-controls-modal
atributo que corresponda a un identificador de elemento modal e, cando se prema, iniciará o seu modal. Para engadir opcións modais, só tes que incluílas tamén como atributos de datos.
- <a class = "btn" data-controls-modal = "my-modal" data-backdrop = "static" > Iniciar modal </a>
Aviso Se queres que o teu modal se anime dentro e fóra, só tes que engadir unha .fade
clase ao teu .modal
elemento (consulta a demostración para ver isto en acción).
Activa o teu contido como modal. Acepta opcións opcionais object
.
- $ ( '#meu-modal' ). modal ({
- teclado : verdadeiro
- })
Alterna manualmente un modal.
- $ ( '#meu-modal' ). modal ( 'alternar' )
Abre manualmente un modal.
- $ ( '#meu-modal' ). modal ( 'mostrar' )
Oculta manualmente un modal.
- $ ( '#meu-modal' ). modal ( 'ocultar' )
Devolve unha instancia de clase modal de elementos.
- $ ( '#meu-modal' ). modal ( verdadero )
Aviso Como alternativa, pódese recuperar con $().data('modal')
.
A clase modal de Bootstrap expón algúns eventos para conectarse á funcionalidade modal.
Evento | Descrición |
---|---|
mostrar | Este evento desenvólvese inmediatamente cando show se chama ao método de instancia. |
mostrado | Este evento desenvólvese cando o modal se fixo visible para o usuario (esperará a que se completen as transicións css). |
ocultar | Este evento desenvólvese inmediatamente cando hide se chamou ao método de instancia. |
agochado | Este evento desenvólvese cando o modal rematou de ocultarse ao usuario (esperará a que se completen as transicións css). |
- $ ( '#meu-modal' ). ligar ( 'oculto' , función () {
- // facer algo ...
- })
Este complemento serve para engadir interacción ao menú despregable á barra superior de arranque ou ás navegacións por pestanas.
Descargar
- $ ( '#barra superior' ). desplegable ()
Para engadir rapidamente a funcionalidade do menú despregable a calquera elemento de navegación, utiliza o data-dropdown
atributo. Calquera menú despregable de arranque válido activarase automaticamente.
- <ul class = "pestanas" >
- <li class = "active" ><a href = "#" > Inicio </a></li>
- <li class = "menú despregable" data-dropdown = "menú despregable" >
- <a href = "#" class = "dropdown-toggle" > Menú despregable </a>
- <ul class = "menú desplegable" >
- <li><a href = "#" > Ligazón secundaria </a></li>
- <li><a href = "#" > Aquí hai outra cousa </a></li>
- <li class = "divisor" ></li>
- <li><a href = "#" > Outra ligazón </a></li>
- </ul>
- </li>
- </ul>
Aviso Se a túa interface de usuario ten varios menús despregables, considera engadir o data-dropdown
atributo a un elemento de contedor máis significativo como .tabs
ou .topbar
.
Unha API programática para activar menús para unha determinada barra superior ou navegación por pestanas.
Este complemento serve para engadir a interacción scrollspy (nav de actualización automática) á barra superior de arranque.
Descargar
- $ ( '#barra superior' ). scrollSpy ()
Para engadir facilmente o comportamento scrollspy ao teu navegador, só tes que engadir o data-scrollspy
atributo ao ficheiro .topbar
.
- <div class = "topbar" data-scrollspy = "scrollspy" > ... </div>
Auto activa os botóns de navegación pola posición de desprazamento dos usuarios.
- $ ( 'corpo > .topbar' ). scrollSpy ()
Teña en conta que as etiquetas de ancoraxe Topbar deben ter obxectivos de identificación resolubles. Por exemplo, un <a href="#home">home</a>
debe corresponder a algo no dom como <div id="home"></div>
.
O scrollspy almacena en caché os botóns de navegación e as coordenadas de sección para o rendemento. Se precisas actualizar esta caché (probablemente se tes contido dinámico), só tes que chamar a este método de actualización. Se usaches o atributo de datos para definir o teu scrollspy, só tes que chamar a refresh no corpo.
- $ ( 'corpo' ). scrollSpy ( 'actualizar' )
Consulta a navegación da barra superior nesta páxina.
Este complemento engade funcións de pestanas e pílulas rápidas e dinámicas.
Descargar
- $ ( '.tabs' ). fichas ()
Podes activar unha navegación por pestanas ou pílulas sen escribir ningún javascript simplemente dándolles un data-tabs
ou un data-pills
atributo.
- <ul class = "tabs" data-tabs = "tabs" > ... </ul>
Activa a funcionalidade de pestanas e pílulas para un determinado recipiente. As ligazóns das pestanas deben facer referencia aos identificadores do documento.
- <ul class = "pestanas" >
- <li class = "active" ><a href = "#home" > Inicio </a></li>
- <li><a href = "#profile" > Perfil </a></li>
- <li><a href = "#messages" > Mensaxes </a></li>
- <li><a href = "#settings" > Configuración </a></li>
- </ul>
- <div class = "contido da pílula" >
- <div class = "active" id = "home" > ... </div>
- <div id = "perfil" > ... </div>
- <div id = "mensaxes" > ... </div>
- <div id = "configuración" > ... </div>
- </div>
- <script>
- $ ( función () {
- $ ( '.tabs' ). fichas ()
- })
- </script>
Evento | Descrición |
---|---|
cambiar | Este evento desenvólvese ao cambiar de pestana. Use event.target e event.relatedTarget para apuntar á pestana activa e á pestana activa anterior respectivamente. |
- $ ( '#.pestañas' ). ligar ( 'cambiar' , función ( e ) {
- e . destino // pestana activada
- e . relatedTarget // pestana anterior
- })
Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.
Banksy do proident, brooklyn photo booth delectus sunt artisan sed organic exercitation eiusmod four loko. Quis tattooed iphone esse aliqua. Master cleanse vero fixie mcsweeney's. Ethical portland aute, irony food truck pitchfork lomo eu anim. Aesthetic blog DIY, ethical beard leggings tofu consequat whatever cardigan nostrud. Helvetica you probably haven't heard of them carles, marfa veniam occaecat lomo before they sold out in shoreditch scenester sustainable thundercats. Consectetur tofu craft beer, mollit brunch fap echo park pitchfork mustache dolor.
Sunt qui biodiesel mollit officia, fanny pack put a bird on it thundercats seitan squid ad wolf bicycle rights blog. Et aute readymade farm-to-table carles 8-bit, nesciunt nulla etsy adipisicing organic ea. Master cleanse mollit high life, next level Austin nesciunt american apparel twee mustache adipisicing reprehenderit hoodie portland irony. Aliqua tofu quinoa +1 commodo eiusmod. High life williamsburg cupidatat twee homo leggings. Four loko vinyl DIY consectetur nisi, marfa retro keffiyeh vegan. Fanny pack viral retro consectetur gentrify fap.
Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.
Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Based on the excellent jQuery.tipsy plugin written by Jason Frame; twipsy is an updated version, which doesn't rely on images, uses css3 for animations, and data-attributes for title storage!
Download
- $('#example').twipsy(options)
Name | type | default | description |
---|---|---|---|
animate | boolean | true | apply a css fade transition to the tooltip |
delayIn | number | 0 | delay before showing tooltip (ms) |
delayOut | number | 0 | delay before hiding tooltip (ms) |
fallback | string | '' | text to use when no tooltip title is present |
placement | string | 'above' | how to position the tooltip - above | below | left | right |
html | boolean | false | allows html content within tooltip |
live | boolean | false | use event delegation instead of individual event handlers |
offset | number | 0 | pixel offset of tooltip from target element |
title | string, function | 'title' | attribute or method for retrieving title text |
trigger | string | 'hover' | how tooltip is triggered - hover | focus | manual |
template | string | [default markup] | The html template used for rendering a twipsy. |
Notice Individual twipsy instance options can alternatively be specified through the use of data attributes.
- <a href="#" data-placement="below" rel='twipsy' title='Some title text'>text</a>
Attaches a twipsy handler to an element collection.
Reveals an elements twipsy.
- $('#element').twipsy('show')
Hides an elements twipsy.
- $('#element').twipsy('hide')
Returns an elements twipsy class instance.
- $('#element').twipsy(true)
Notice Alternatively, this can be retrieved with $().data('twipsy')
.
Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
The popover plugin provides a simple interface for adding popovers to your application. It extends the bootstrap-twipsy.js plugin, so be sure to grab that file as well when including popovers in your project!
Notice You must include the bootstrap-twipsy.js file before bootstrap-popover.js.
Download
- $('#example').popover(options)
Name | type | default | description |
---|---|---|---|
animate | boolean | true | apply a css fade transition to the tooltip |
delayIn | number | 0 | delay before showing tooltip (ms) |
delayOut | number | 0 | delay before hiding tooltip (ms) |
fallback | string | '' | text to use when no tooltip title is present |
placement | string | 'right' | how to position the tooltip - above | below | left | right |
html | boolean | false | allows html content within tooltip |
live | boolean | false | use event delegation instead of individual event handlers |
offset | number | 0 | pixel offset of tooltip from target element |
title | string, function | 'title' | attribute or method for retrieving title text |
content | string, function | 'data-content' | a string or method for retrieving content text. if none are provided, content will be sourced from a data-content attribute. |
trigger | string | 'hover' | how tooltip is triggered - hover | focus | manual |
template | string | [default markup] | The html template used for rendering a popover. |
Notice Individual popover instance options can alternatively be specified through the use of data attributes.
- <a data-placement="below" href="#" class="btn danger" rel="popover">text</a>
Initializes popovers for an element collection.
Reveals an elements popover.
- $('#element').popover('show')
Hides an elements popover.
- $('#element').popover('hide')
The alert plugin is a super tiny class for adding close functionality to alerts.
Download
- $(".alert-message").alert()
Just add a data-alert
attribute to your alert messages to automatically give them close functionality.
Name | type | default | description |
---|---|---|---|
selector | string | '.close' | What selector to target for closing an alert. |
Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade
and .in
class already applied to them.
Closes an alert.
- $(".alert-message").alert('close')