Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Jun 2014
    Posts
    37
    Member #
    39433
    Liked
    1 times

    Link to a pure CSS modal already 'poppedup'

    Hi All,

    I am using a pure css template for modal popups. I would like to know how to make a link to an already 'poppedup' modal so I can share it.

    Thanks


    Fiddle


    HTML
    Code:
    <label for="modal1">OPEN</label>
    <input type="checkbox" class="modal" id="modal1">
    <div class="modal">
      <article>
        <p>Modal content here!</p>
      </article>
      <label for="modal1" class="close"></label>
      <label for="modal1" class="overlay"></label>
    </div>
    CSS
    Code:
    label {
      color: #00f;
      text-decoration: underline;
      cursor: pointer
    }
    
    .modal,
    .modal * {
      box-sizing: border-box;
      -moz-box-size: border-box;
      transition: all .2s ease-in-out
    }
    
    .modal:checked+.modal {
      opacity: 1;
      pointer-events: all
    }
    
    .modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 500;
      padding: 15px;
      overflow-y: scroll;
      opacity: 0;
      pointer-events: none
    }
    
    .modal article {
      background: #fff;
      width: 100%;
      padding: 50px;
      position: relative;
      z-index: 700
    }
    
    .modal .close:before {
      content: '';
      display: block;
      padding: 20px 30px;
      font-size: 200%;
      position: absolute;
      top: 0;
      right: 0;
      z-index: 800;
      cursor: pointer
    }
    
    .modal .close:hover:before {
      color: #c00
    }
    
    .modal .overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, .5);
      z-index: 600;
      cursor: pointer
    }

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    You can use a query string in your address (http://someaddress.site?modal=true). You'll just parse the query string with JavaScript and set the value of the checkbox to "on".
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:41 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com