Making a floating javascript pop up that you can move around.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miraan
    New Member
    • Apr 2008
    • 24

    Making a floating javascript pop up that you can move around.

    Does anybody know the code for making a pop up that is draggable. An example is the one on http://www.planetsms.c o.uk, when you go to the page it comes up with a small pop up with a form inside, does anyone know how to make a pop up like that. Please look at example before replying.
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Originally posted by miraan
    Does anybody know the code for making a pop up that is draggable. An example is the one on http://www.planetsms.c o.uk, when you go to the page it comes up with a small pop up with a form inside, does anyone know how to make a pop up like that. Please look at example before replying.
    You may find style.position, style.left, style.top, event.pageX, event.pageY, event.clientX, event.clientY and zIndex useful in this case.

    Comment

    • pronerd
      Recognized Expert Contributor
      • Nov 2006
      • 392

      #3
      Originally posted by miraan
      does anyone know how to make a pop up like that.
      Yes, but if you are expecting us to write the code from scratch for you I think you will be disapointed.

      That is a floating layer, not a pop-up. You just need to create a layer, and then create the logic to set the CSS style values mentioned above from onMove events. A strong understanding of CSS attributes will be needed for this.

      Comment

      Working...