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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:52:11+00:00 2026-05-27T23:52:11+00:00

Hi friends I have issue with divs. I have a link show/hide dive on

  • 0

Hi friends I have issue with divs.
I have a link show/hide dive on my page on clicking which i have to show or hide specific divs.
I am successful with doing it.
But my issue is that whenever I click on that link div is get hide or shown but page get directly on the top & I have to scroll to down again.
I don’t want to scroll this and don’t want to get to top.

Please help me out with this.
Thank You in advance.

Update:
Friend I got the answer from one of my friend.
Actually I was using
Because of href=”#” URL get changed and page got to top every time I click on that link.

  • 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-27T23:52:12+00:00Added an answer on May 27, 2026 at 11:52 pm

    Are you trying to do this?

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <title></title>
        <meta charset="utf-8">
    </head>
    <body>
    
        <div id="wrapper">
            <div id="container">
    
            </div><!-- end of #container div -->
    
            <a id="showdiv">Show the div</a>|<a id="hideDiv">Hide the div</a>|<a id="toggle">Toggle</a>
    
        </div><!-- end of #wrapper div -->
    
    </body>
    </html>
    

    Here’s the css:

    #container {
     width: 300px;
      height: 300px;
       background: red; 
        margin-bottom: 20px;
    }
    
    #wrapper {
     margin: 40px auto;
     width: 400px;
    }
    

    And here’s the jquery

    $(function() {// When document is ready, run this...
    
    //Get hold of the link with the id #showdiv and do something when you click it
    $("#showdiv").click(function() {
        // Grab the div with the id #container and show it
        // Alert me when you're done
        $("#container").show(2000, function() {
            alert("I'm done showing");
        });
    });
    
    //Get hold of the link with the id #hideDiv and do something when you click it
    $("#hideDiv").click(function() {
        // Grab the div with the id #container and hide it
        // Alert me when you're done
        $("#container").hide(2000, function() {
            alert("I'm done hiding");
        });
    
    });
    
    // Toggle - This is like a On/Off Switch
    //Get hold of the link with the id #toggle and do something when you click it
    $("#toggle").click(function() {
        // Grab the div with the id #container and show if hidden / hide if shown
        $("#container").toggle(2000);
    });
    
    });
    

    Of course you’d have to link to a copy of jQuery before using the script above.
    Here’s a link to a demo: http://jsfiddle.net/tonystark/HhNBA/

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

Sidebar

Related Questions

Hello friends I have tried many times but I am not successful than please
I have created an invite friends code, which is properly working if an FB
Running into an issue, which most likely is a permission thing with Facebook, but
Hello friends I have an issue adding a special class to a couple of
Hello friends a newbie question... The Issue is like this: I have a static
Friends, My issue is that my page is really slow to load, because all
This issue may have be raised here before, but I am not confident that
Hey friends can you help me out with this issue. I have a JSON:
Hello friends I Have a float type variable ,which contains a total price of
My friends, I have an issue that I hope you can help me. So..Here

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.