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

  • SEARCH
  • Home
  • 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 8852949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:31:41+00:00 2026-06-14T13:31:41+00:00

On my page I have four links that show and hide a div each.

  • 0

On my page I have four links that show and hide a div each. Take a look here.

The markup for the links is as follows:

<li class="togglelink fadein button" data-block="albums" id="togglealbums">Albums</li>
<li class="togglelink fadein button" data-block="about" id="toggleabout">About Me</li>
<li class="togglelink fadein button" data-block="contact" id="togglecontact">Contact</li>

and

<img src="images/info.png" class="button nav_button fadein toggleinfo" id="info" alt="Show Info Pane" title="Show Info Pane">

The CSS for the fadein class is as follows:

.fadein {opacity:0.5; transition:opacity 0.5s; -webkit-transition:opacity 0.5s; -moz-transition:opacity 0.5s; -ms-transition:opacity 0.5s;}
.fadein:hover {opacity:1.0;}

And the jQuery that shows/hides the target divs is as follows:

$('.togglelink').on('click',function() {
  var id = $(this).data('block');
  $('#'+id).fadeToggle('slow').siblings('.toggleblock').fadeOut('fast');
});

$('.toggleinfo').click(function() {
  $('.info').fadeToggle('slow');
});

What I want to happen is that when the target div is open (albums, about, contact, and info, respectively) the link that targets it stays at opacity: 1.0.

I tried this:

$('.togglelink,.toggleinfo').click(function() {
  $(this).toggleClass('fadein active');
});

Where the active class is:

.active {opacity: 1.0;}

But this had two issues: using the close buttons on the panes themselves won’t cause the links to go back to semi-transparent, and, in the case of the top 3 links, clicking one link and then another will result in two fully opaque links.

The code for the close buttons is like this:

<img src="images/close_pane.png" class="togglelink fadein close_pane button" data-block="albums" alt="Close Album List" title="Close Album List">

How can I fix these issues? Thanks!

  • 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-06-14T13:31:43+00:00Added an answer on June 14, 2026 at 1:31 pm
    $('.togglelink,.toggleinfo').click(function() {
        $(this).siblings('.active').toggleClass('fadein active');
        $(this).toggleClass('fadein active');
    });
    
    $('.close_pane').click(function(){
        $('li[data-block="'+ $('this').data('block') +'"]').removeClass('active').addClass('fadein');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have four links which open on an iframe on that same page. My
I am trying to get a simple page up that will have four links
I have a page that needs to combine data from four different webrequests into
I have a main Event class, and four event types. Each of them is
Hi I have a page for which I have four different style sheets like
I have a xaml navigation page with 5 listboxes (Silverlight 3). Four of the
http://blog.helpcurenow.org/test/mockups/mar2010/lp.html In the above landing page, I have an offers box that has four
I have a page that have fileupload control, on the submission of the form,
I have a rewrite rule that works for my index page RewriteRule ^index$ index.php
If this were just a static website, i would have four links <li><a href=javascript:void(0)>Action

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.