creating a pop up with div tag

Discussion in 'JavaScript' started by andrewliu, Aug 4, 2010.

  1. #1
    Hello, I have this simple div tag that I want to pop up. This site has a simple script:

    http://www.javascripttoolbox.com/lib/popup/example.php

    I'm using the "Simple Popup Using In-Page DIV" example.

    I was wondering if anyone can help me figure out what the javascript code is to make the Popup.show() function work?

    I'm new to php/javascript and need help :(

    Also, if you can, can you help me make the pop up dragable and have a close link?

    Thank you
     
    andrewliu, Aug 4, 2010 IP
  2. pom4ik

    pom4ik Greenhorn

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    16
    #2
    pom4ik, Aug 4, 2010 IP
  3. andrewliu

    andrewliu Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I was looking at the source code, and I saw a popup.js script they had. It was super long, is there a shorter script that I might be able to get?

    I'm new to coding. Thanks

    Edit: I made a div tag and a javascript code where if a user clicks more, it shows more from my list. But how do i make it pop out of the screen without the window page.

    <script type="text/javascript">
      function pop(div)
    {
    document.getElementById(div).style.display='block';
    return false
    }
    function hide(div)
    {
    document.getElementById(div).style.display='none';
    return false
    }</script>
    
    <a href="#" onclick="return pop('pop1');">more...</a>
    
    <a href="#" onClick="return hide('pop1')">Close</a>
    
    PHP:
     
    Last edited: Aug 4, 2010
    andrewliu, Aug 4, 2010 IP