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 9090401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:21:49+00:00 2026-06-16T22:21:49+00:00

I have the HTML structure as follows: <div class=boxes workshops wrapl> <a href=# id=showw1

  • 0

I have the HTML structure as follows:

<div class="boxes workshops wrapl">
    <a href="#" id="showw1" class="workshops-button lfloat">Show it</a>
</div>

<div class="boxes exhibitions">
    <a href="#" id="showex1" class="exhibitions-button lfloat">Show it</a>
</div> 
<div class="boxes gallery">
    <a href="#" id="showex1" class="gallery-button lfloat">Show it</a>
</div>

The class .boxes are squares set next to one another. There are about 30 boxes.
Initially all the boxes are set to opacity:1 and all the -button class are set at opacity:0.

However, then also if I hover my mouse inside the .boxes, the links are clickable.

My .navi menu:

<div id="navi">
    <a href="#"><div id="t0"><span>Home</span></div></a>
    <a href="#"><span>Events</span></a>
    <a href="#"><span>Gallery</span></a>
    <a href="#"><span>Exhibitions</span></a>
</div>

My javascript code for changing the opacity.

    <script type="text/javascript">
    var isHome = true;
        $(function () {

            $("#navi a").click(function() {
                c = $(this).text().toLowerCase();
                isHome = c=="home";
                if (isHome){
                    $('.events-button, .workshops-button, .gallery-button, .sponsors-button, .hospitality-button, .lectures-button, .exhibitions-button').animate({opacity:0.0},500);
                    $(".boxes").animate({opacity: 1.0}, 500 );

                } else {
                    $('.' + c).animate({opacity: 1.0}, 500 );
                    $('.' + c + "-button").animate({opacity: 1.0}, 500 ).addClass('activehack');
                    $('.activehack').not('.' + c + "-button").animate({opacity: 0.0}, 500 );
                    $('.boxes').not('.' + c).animate({opacity: 0.3}, 500 );
                }
            });
        });
</script>

How can I remove the click event of the -button elements when they are not visible?

EDIT #1
I don’t have to click the .-button elements.

When I click home, all .boxes should appear, but the <a>..</a> elements in each .boxes must not be clickable.
Then if I click .events, only the .boxes with class: .events should appear alongwith <a>...</a> elements having .events-button class[and they should be clickable now.]

The Jsfiddle is here.

  • 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-16T22:21:50+00:00Added an answer on June 16, 2026 at 10:21 pm

    working demo

    $('a[class="button"]').click(function(e){ // <--- don't miss this e
        if ($(this).css('opacity')==0) e.preventDefault();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the HTML structure as follows: <div class=boxes workshops wrapl> <a href=# id=showw1
I have this HTML structure <div class=buttons> <button data-icon=ui-icon-disk class=save>Save1</button> <button data-icon=ui-icon-check class=ok>OK1</button> <button
I have this html structure <div class=top_menu> <ul> <li class=left><a href= class=family-filter>asdas</a></li> <li class=welcome>Welcome
I have a HTML structure like follows <div id=answer-1> <a class=edit></a> </div> <div id=answer-2>
I have my HTML structure as follows: <div id=id1> <h1>my name </h1><h3><a href=mailto:myemail_id>myemailid@xyz.com</a></h3> </div>
I have a HTML structure as follows: <div class=container> <label>Name:</label> <div class=controls> <input type=text
I have HTMl structure as follows <div class=comments_options id=comment_2> <span>2 comments</span> </div> In Mootools
I have a html structure like : <div onmouseover=enable_dropdown(1); onmouseout=disable_dropdown(1);> My Groups <a href=#>(view
Assuming I have this HTML structure: <ul class='menu'> <li> <div></div> <div> <div></div> <div> <a
I have a DOM structure as follows: <div class=hotspot> <div class=hotspot_inner> <div class=hotspot_info> <div

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.