www.webdeveloper.com
Results 1 to 3 of 3

Thread: popup javascript

  1. #1
    Join Date
    Aug 2009
    Posts
    23

    popup javascript

    here is what im trying to do, I have a box with text in it and I want to have a an onclick event that pop up a window that will allow user to change font style, size and color.
    THis website has a perfect example:http://www.tinyprints.com/personaliz...ml#personalize

    I dont want it to be a regular window, instead more like a hidden div that becomes visible next to the textbox that is clicked.

    Thanks

  2. #2
    Join Date
    May 2003
    Location
    Between Baltimore and DC
    Posts
    3,579
    Show:
    Code:
    document.getElementById("foo").style.display="block";
    Hide:
    Code:
    document.getElementById("foo").style.display="none";

    The box css
    Code:
    #foo{
      position: absolution;
      top: 100px;
      left: 200px;
      border: 1px solid black;
      width: 200px;
      height: 200px;
      background-color: #CCCCCC;
      display: none;
    }

    Eric

  3. #3
    Join Date
    Aug 2009
    Posts
    23
    Thanks Eric, that seems to do the job just fine.
    However, now I have another issue, I want the popup to display next to the textbox that activated it.
    How do i get its location if it is nested within several controls.
    i.e.
    <body>
    <div>
    <table>
    <tr>
    <td>
    <input id="name" onclick="showDiv()" />
    </td>
    </tr>
    </table>
    </div>
    </body>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles