Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3497906
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:25:46+00:00 2026-05-18T12:25:46+00:00

I asked this question yesterday got a pretty good answer but can’t figure out

  • 0

I asked this question yesterday got a pretty good answer but can’t figure out how to repost new code to get an answer to another question about the same code. I have buttons that I want to show/hide divs with information about a particular event/venue.

Here is the button html:

<img class="event" src="images/but_event_info.png" width="79" height="26" alt="Event Information" id="Event<?php echo $row_rsSchedules['EventID']; ?>But" /><img class="venue" src="images/but_venue_info.png" width="79" height="26" alt="Specific Venue Information" id="Venue<?php echo $row_rsSchedules['VenueID']; ?>But" /></p>

And the divs that I want to show:

<div class="VenueInfo" id="<?php echo 'Venue'.$row_rsSchedules['VenueID'].'Div'; ?>">Venue Info for <?php echo $row_rsSchedules['VenueID']; ?></div>
<div class="EventInfo" id="<?php echo 'Event'.$row_rsSchedules['EventID'].'Div'; ?>">Event Info for <?php echo $row_rsSchedules['EventID']; ?></div>

Here is the jquery code to show/hide the divs:

<script type="text/javascript">
$(document).ready(function() {
   $(".event.hidden").click(function () {
    var div_id = this.id.replace(/But/, 'Div');
$("#" + div_id).show('fast', 'linear'); 
   //$(this).siblings("div").show();
   $(this).removeClass('hidden').addClass('shown').text('Hide Event');
});
$(".event.shown").click(function () {
   var div_id = this.id.replace(/But/, 'Div');
 $("#" + div_id).hide('fast', 'linear'); 
   //$(this).siblings("div").hide();
   $(this).removeClass('shown').addClass('hidden').text('Event Details');
});

});
</script>

The answer was given to me at jquery show()/Hide() dynamically named elements

The answer that tandu gave was:
jQuery makes this very simple. As it seems that you can multiple event descriptions on the page at once, you may want to attach a class, “event”/”venue” to the appropriate buttons, also add ‘hidden’ class to them all at first since I think they all start off hidden, then this JS:

I simply added style settings like so:

<style type="text/css"> 
.VenueInfo {
 display: none;
}
.EventInfo {
 display: none;
}
.event {
 display: inline;
}

.event {
 display: inline;
}
</style>

Pardon me for the fact that I don’t know how to repost new code after I have made changes to the same question. Every time I have posted a question, I get answers and then never a response after I have made changes.

I thank you for you help in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:25:46+00:00Added an answer on May 18, 2026 at 12:25 pm

    I’m not sure what you are asking, I guess you are having problems with showing the divs again, so change to

    display: block;
    

    your current

     display: inline;
    

    Edit: and also you need to name your CSS classes accordingly to the classes you are adding/removing with Jquery

    so your css should have

    .show{ display: block;}
    .hidden { display: none; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Yesterday, I asked this question and never really got an answer I was really
I've asked this question yesterday and got lots of good answers, only I just
(I asked this question in another way , and got some interesting responses but
I originally asked this question on RefactorMyCode , but got no responses there... Basically
I asked a question yesterday and the answer I got has answered the first
Following on from this question I asked yesterday: Can I shorten this regular expression?
I asked this question on the jQueryUI forums, but got no response. I've created
I asked this question two months ago and got nary an answer. In fact
This is similar to a question I asked yesterday but more specific to the
This question is related to another question which I asked yesterday! List all links

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.