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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:09:04+00:00 2026-05-27T13:09:04+00:00

In the given fiddle, I tried to develop a modal window using only html5

  • 0

In the given fiddle, I tried to develop a modal window using only html5 and css3 . The modal window is working fine but the div’s id is being displayed with the url, so if i just click back without closing the modal window and come back, the modal window remains opened.

I know its all because of the div’s id is getting added with the URL when the modal window is opened and its id is displayed with the url like this

http://localhost:90/modal.html#divModalDialog1

How can i remove the modal div’s id from the url ?

JS Fiddle – http://jsfiddle.net/bala2111/4UCGL/4/

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Modal CSS 3</title>
    <style type="text/css">
        /*** pop-up div to cover entire area ***/
         .divModalDialog  {
            position:fixed;
            top:0;
            left:0;
            width:100%;
            height:100%;
            /*! important !*/
            display:none;
            /* last attribute set darkness on scale: 0...1.0 */
            background-color:rgba(0,0,0,0.7);
            text-align:center;
            z-index:101;
        } 

        /*** ! target attribute does the job ! ***/
         .divModalDialog:target  { display:block; } 

        /*** virtual frame containing controls, image and caption ***/
         .divModalDialog div  {
           /* either absolute or fixed */
            position:fixed;
            top:5%;
            width:100%;
            height:80%;
            /* rounded corners */
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
            z-index:102;
        }

        #manual{
        width:920px;height:440px;
        background-color:#ffffff;
        position:absolute;
        margin-left:200px;
        }

        #close{
        margin-left:890px;
        }

</style>
<script>
function test()
{
    //alert('aaa');
    //window.history.go(-1);
    window.location.href="http://localhost/html_modal/test.php";
}

</script>
</head>

<body>

    <!-- NAV THUMBNAILS -->
    <div id="divThumbnails">
        <ul>
            <li><a href="#divModalDialog1">Click Me</a></li>
        </ul>
    </div>

    <!--1st LINK -->
    <div id="divModalDialog1" class="divModalDialog">
        <div id="manual"><span id="close"><a href="#" onclick="test();"><img src="images/close_icon.png" /></a></span></div>
    </div>

</body>
</html>
  • 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-27T13:09:04+00:00Added an answer on May 27, 2026 at 1:09 pm

    Make your div default non-visible en make it visible with javascript.

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

Sidebar

Related Questions

Relevent jsFiddle: http://jsfiddle.net/julianlam/eLs9E/ For some reason, given the dataset shown in the fiddle, when
I was given the script found here http://jsfiddle.net/b2Nq9/2/ but cannot get it to seem
Here is my fiddle http://jsfiddle.net/vZjnd/ Given the facts .wrapper height is fixed. .main is
Two questions about this fiddle. http://jsfiddle.net/mjmitche/4emqh/2/ 1) Originally, the black box (with div id
I am trying to add days to a given date using Javascript. I have
fiddle code: <button onclick=this.disabled=true; setTimeout(function(){this.disabled=false;},500);>click</button> this seems to refer to the window rather than
I am using some code from a fiddle made by a member of StackOverflow.
I have been given the following: <div class=elf>Label 1</div> <div class=eff>Data 1</div> <div class=elf>Label
I have four divs in my html page something like this: the working fiddle
Given the following Fiddle, how can I make the red rectangle stand upright in

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.