.  

 

 

.
.

23 / 03 / 2017

Usuarios conectados: 8

Cargando documento...

Buscar:

.

Este Sitio:

Principal

Dreamweaver

Fireworks

JavaScript

CSS

Sonido

Artículos

Links

E-ufemismos

Descargas

Historial

 

Mailing List:

Suscríbete a la lista de correo, No practico spamming y ofrece algunas ventajas.

Pulsa aquí para saber más y suscribirte.

 

Recomendados:

Tecnorama >JavaScript

 

Extending Spry's Accordion Widget

Versión para imprimir | Translate this page

Recently I found myself in the need to create a Spry accordion that whould hide panels on user’s request.

Spry won't add this feature by default, so it was time to add it. And it's really easy (I love Spry!):

Here are the three methdos I created:

getDisplay(element): You won’t need to use it by default. It simply receives an element and tells the value for the style.display property. However, it´s used by the other 2 methods:

Spry.Widget.Accordion.prototype.getDisplay = function(ele){
 if( ele ) return ele.style.display;
}

 

hideActivePanel(): it will hide the currently open panel. it´s content is not destroyed. to use it, simply call: yourAccordionName.hideActivelPanel()

Spry.Widget.Accordion.prototype.hideActivePanel = function(){
 var tabToHide=this.getPanelTab(this.getCurrentPanel());
 var contentToHide=this.getPanelContent(this.getCurrentPanel());
 var curPanelIndex=this.getCurrentPanelIndex();
 var nextPanelIndex=this.getCurrentPanelIndex()+1;
 this.setDisplay(tabToHide,'none');
 this.setDisplay(contentToHide,'none');
 for(i=nextPanelIndex;i<this.getPanels().length;i++){
  if(this.getDisplay(this.getPanelTab(this.getPanels()[i]))!='none'){
   this.openPanel(this.getPanels()[i]);
   return;
  }
 }
 for(i=curPanelIndex;i>=0;i--){
  if(this.getDisplay(this.getPanelTab(this.getPanels()[i]))!='none'){
   this.openPanel(this.getPanels()[i]);
   return;
  }
 }
}

 

showAllPanels(): This method will show all the panels that are hidden. To use is, call yourAccordionName.showAllPanels()

Spry.Widget.Accordion.prototype.showAllPanels = function(){
 for(i=0;i<this.getPanels().length;i++){
  var curPanel=this.getPanelTab(this.getPanels()[i]);
  if(this.getDisplay(curPanel)=='none') this.setDisplay(curPanel,'block');
 }
 var panelContent=this.getPanelContent(this.getCurrentPanel());
 this.setDisplay(panelContent,'block');
}

 

You can see a demo here

Also, you can see the whole js file here

¿Comentarios? 11, de momento. Mostrando 1 ->5

1.- block ended this [url=http://onlinecasino-xx.com]online casino[/url] where you can conquer legitimate notes with the serve of this guidebookPlaying [url=http://onlinecasinos-x.com/online-blackjack.html]blackjack online[/url] , buy [url=http://adultsrus.us]sex toys[/url]

2.- agree ended this [url=http://onlinecasino-xx.com]casino[/url] where you can prevail in legitimate notes with the avoid of this guidePlaying [url=http://onlinecasinos-x.com/bitcoin-casino.html]bitcoin casino[/url] , buy [url=http://esextoyfun.com]sex toys[/url]

3.- Então e o lider da oposição e grande imbentor do Túnel do Marquês diz o quê?Será que não diz nada porque está lá para sistematicamente inexistir ou tal deve-se a ter ido a Moçambique mandar bitates num evento qualquer relacionado com &qoit;tecnologoas&quut;(!!!)?

4.- zau?Si sa te duci matale la carciuma si sa incarci filme si muzica “la negru” si apoi sa plateasca paolnnur!Buta treaba!Una e sa-ti asigure un hotelier internet in camera (contracost – bineinteles) si alta e sa dea drumul la wireless intr-o carciuma in spatiul public.

5.- What a cutie pie! That second image is ggoreous and I love the one with her tongue sticking out. I can see why you'd want to take that little doll home with you http://ghdlcmokudc.com [url=http://oxjytq.com]oxjytq[/url] [link=http://pzowsjnai.com]pzowsjnai[/link]

« Previous | 1 - 5 | 6 - 10 | 11 - 11 | Next »

Añade tu comentario



Escribe el código de la imagen superior:

:

TECNORAMA es simplemente una página personal. No sirve ni de promoción del autor ni cosas por el estilo.
Todos los códigos, textos y tutoriales son de libre uso mientras se mencione al autor (no es mucho pedir)
Este sitio es compatible con IE6/NS6/Mozilla1.0
Para contactar, puedes enviarme un e-mail a tecnorama@hotmail.com