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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:30:10+00:00 2026-06-14T20:30:10+00:00

I have a jQuery question, and I really think it is a silly one

  • 0

I have a jQuery question, and I really think it is a silly one : i’m a beginner in JS and jQuery…

I’m using

$("#myLink").click(function(){
    $(".myClassToShow").show();
    $(".myClassToHide").hide();
});

to hide elements with class myClassToHide as a class attribute and show elements with class myClassToShow as a class attribute. I think this is really easy to understand 🙂

I didn’t think it would hide every elements with the good class, but, well, it works.

My worry here is that my elements show and hide only for few seconds : the time my mouse click on the link.

I would like to make myClassToShow elements remaining on the screen, when i already clicked my link, and myClassToHide elements really hide.

For example, on the johann Hammarstrom’s website, when you click on “Print”, all his works which are not print gone hide, and only the printing one remain.

That’s kinda what i want. I searched using Firebug, but couldn’t find which kind of event he used. I know a onchange is not the correct answer, so what?

Could you help me please?

(by the way, Thanks by advance for your time)

  • 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-14T20:30:11+00:00Added an answer on June 14, 2026 at 8:30 pm

    I think you’re missing e.preventDefault();, if I understood you correctly.

    $("#myLink").click(function(e) { // Add the event parameter.
        $(".myClassToShow").show(); // .show('fast'); for animation effect.
        $(".myClassToHide").hide(); // .hide('fast'); for animation effect.
    
        // Prevent the default action of the event to be triggered.
        e.preventDefault(); 
    
        // Or use
        return false;
    });
    

    The part you were looking for is in this file: http://johanhammarstrom.se/wp-content/themes/garnish/js/jquery.custom.js?ver=1.0
    Search for portfolioTerms.click.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return
I'm really new to JavaScript and jQuery. My question is this. I have two
i have one question about jquery ajax().. I created a table grid and there
I have a question about jQuery load best practice. Imagine the following situation: $(#div).on('click',
I have a simple question regarding jQuery selectors. I'm using the tablesorter and I
Another jQuery question for you guys. Say I have a url of an image
i have a very conceptual question regarding jquery. i have this fiddle http://jsfiddle.net/zvCrN/ What
Okay guys, I have read through all the other posts and question on jQuery
I have this question: How could I call a codebehind method from jquery? I
I have a simple question about the expression in jquery to select a class

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.