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

The Archive Base Latest Questions

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

HERE I have a sample to illustrate my problem. If you scroll to line

  • 0

HERE I have a sample to illustrate my problem.

If you scroll to line 41 you can hide / show a fixed box. It works as expected: semitransparent box hides and the page remains quiet.
But if you click on the bottom image the box also hides but the page scrolls to top.

How can avoid that and get the page fixed where the user has scrolled it?

<div id="container">
    <div id="box" class="oculto">BOX BOX</div>
    1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>
    11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br>
    21<br>32<br>23<br>24<br>25<br>26<br>27<br>28<br>29<br>30<br>
    31<br>32<br>33<br>34<br>35<br>36<br>37<br>38<br>39<br>40<br>

    <button onclick="$('#box').hide();">Hide the box </button><br>  
    <button onclick="$('#box').show();">Show the box </button><br>     
    <img src="http://static.adzerk.net/Advertisers/4c4f1be011a447efbce49c1811022e7a.png" width="330" border="0" usemap="#Map" /> 

 </div>

<map name="Map" id="Map">
<area shape="rect" coords="3,3,320,84" href="#" onclick="$('#box').hide();"/>  

CSS

#container {
width: 400px;
background-color:yellow;
position:relative; 
z-index:2;
min-height:1000px;
}

#box{
width:400px; 
height:100px;
position:fixed;
top:0;
z-index:100000;
background-color:black;
color:yellow;
opacity:0.5;
padding:10px;
}
  • 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-13T20:35:31+00:00Added an answer on June 13, 2026 at 8:35 pm

    Just get rid of the href on the map. I forked your jsfiddle.

    <area shape="rect" coords="3,3,320,84" onclick="$('#box').hide();"/>   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a demo here to illustrate my problem http://www.ttmt.org.uk/forum/gallery1/ It's a simple list
Here is some sample code to illustrate the problem I am having. #include <iostream>
I have a demo here to illustrate my problem http://www.ttmt.org.uk/ It's just a simple
Here's a sample table to help illustrate my problem: mysql> select * from test;
I have a sample project here on github where I created a c++ wrapper
I am using the sample provided here and have used the code inside a
I have the following sample dataset (below and/or as CSVs here: http://goo.gl/wK57T ) which
I have a bare-bones sample project here: http://dl.dropbox.com/u/7834263/ExpandingCells.zip In this project, a UITableView has
Here is the sample data for test table I have [childId] [parentId] [present] 1
I have built a simple menu in jQuery http://vanquish.websitewelcome.com/~toberua/ Here is a sample of

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.