Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mi Accordion usando show() , slideup() (se puede hacer con toggle reemplazando el .show por .toggle y quitando el slideup) (contraparte el toggle es lento y se bugea con muchos clicks)
- Esto se usa generalmente en preguntas frecuentes
- <script type="text/javascript">
- jQuery(function(){
- jQuery('.preguntas').bind('click',function(){
- var id = jQuery(this).attr('id');
- var pos = id.substring(10,8);
- var tam = id.length;
- for(var i=0;i<=22;i++){
- if(i==pos){
- var estado = jQuery('#rsp'+i).css('display');
- jQuery('#rsp'+i).show("slow");
- if (estado=='block'){
- jQuery('#rsp'+i).slideUp();
- jQuery('#rsp'+i).parent().css('list-style-image','url("<?php bloginfo('template_url') ? >/images/mas.png")');
- }
- else{
- jQuery('#rsp'+i).parent().css('list-style-image','url("<?php bloginfo('template_url') ?>/images/menos.png")')
- }
- }
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment