vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   jQuery slideUp() and slideDown() problem (https://vborg.vbsupport.ru/showthread.php?t=288139)

Lilmikeishere 09-21-2012 10:24 PM

jQuery slideUp() and slideDown() problem
 
I'm trying to make it so when you click a button, information appears and when you click it again, it slides back.

CSS:
PHP Code:

#content{
display:none;


HTML:
PHP Code:

<div id="content">
context here
</div>
<
input type="button" id="myButton">&#8203; 

Script:
PHP Code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<
script>
$(
"#myButton").toggle(function(){
    $(
"#content").slideDown();
    $(
this).val("Slide Down");
},function(){
    $(
"#content").slideUp();
    $(
this).val("Slide Up")
})
</
script

It works but only for the first poster.

AcheronAI 09-21-2012 10:47 PM

Because the first button is named the same as the rest, they each need to be different if I am not mistaken, like mybutton1 mybutton2

Lilmikeishere 09-21-2012 10:53 PM

Quote:

Originally Posted by AcheronAI (Post 2367471)
Because the first button is named the same as the rest, they each need to be different if I am not mistaken, like mybutton1 mybutton2

The purpose is for the button to make the text slide out, and then slide in after another click.

AcheronAI 09-21-2012 11:01 PM

Yes but if there is more then one button they each need their own id's

Lilmikeishere 09-21-2012 11:13 PM

Quote:

Originally Posted by AcheronAI (Post 2367474)
Yes but if there is more then one button they each need their own id's

I see only a single button.

Lilmikeishere 09-23-2012 04:05 PM

Switched the id to classes and it works now for all the boxes but the first poster of the thread controls them all the page of posts.

Scanu 09-27-2012 05:05 PM

You can take a look to my mod "collapsible sognature" it does it in a hacky way

Lilmikeishere 09-28-2012 05:32 PM

Quote:

Originally Posted by Scanu (Post 2369055)
You can take a look to my mod "collapsible sognature" it does it in a hacky way

I'm assuming your mod mimics a hide/show or a spoiler button. That can be done with HTML and I'm currently using that but I would really like to get the sliding effect to work.

Scanu 10-02-2012 05:17 PM

It use a jquery slide effect


All times are GMT. The time now is 12:40 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00966 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete