★ wanayoo — archive 1999 http://developer.iplanet.com/docs/examples/dynhtml/dragable/index.htmlNouvelle recherche | Portail wanayoo
iPlanet

You are here:  Home > Developers > Sample Code > Dynamic HTML > Dynamic HTML Sample Code
Dynamic HTML Sample Code
 iPlanet Developers


Developer Program
  Membership
  One-to-One Support
  Newsgroups
  Member Services

Developer Publications
  View Source
  Developer News

Documentation
  Technical Manuals
  White Papers
  TechNotes
  Sample Code
  FAQs
  Books

Technologies
  CSS
  DOM
  CORBA
  Directory & LDAP
  Dynamic HTML
  Java
  JavaScript
  Linux
  RDF
  Security
  SSJS
  XML
  XUL

Developer Downloads
  Tools & SDKs
  Patches

iPlanet Products
  Technical Resources










spacer
Drag and Drop Component

INTRODUCTION

This simple component let you add a drag and drop mechanism to your page, with minimal coding from you. Note that this component is not meant to be extensive, and should be seen as a starting point.

View Example( Requires Netscape Communicator)
 

USING THE COMPONENT

<script language=javascript1.2 src=/old?u=http%3A%2F%2Fdeveloper.iplanet.com%2Fdocs%2Fexamples%2Fdynhtml%2Fdragable%2Fdragable.js&y=1999></script>

<script language=javascript1.2 >
  var d= new Dragable( 100, 100, "<h1>Drag me</h1>");
</script>
REFERENCE

The constructor accepts two possible syntax:

  • new Dragable(x, y, html)

  • This creates a layer containing 'html', at the position (x,y), and makes this layer dragable.
  • new Dragable(layer)

  • This takes an existing layer, and makes it dragable.

In both cases, an object is returned. This object has the following members:

  • layer: Layer object. read-only. points to the dragable layer.
  • onmove: event handler. This handler is called each time the pointer is moved over the layer.
  • ondown: event handler. This handler is called when the user starts clicking on the layer.
  • ondrag: event handler. This handler is called each time the layer is dragged.
  • ondrop: event handler. This handler is called when the layer is dropped.

These four handlers are called with the Dragable object as argument.

SOURCE

    The source of the component can be found here.
 


Related Readings:


Any sample code included above is provided for your use on an "AS IS" basis, under the Netscape License Agreement - Terms of Use

spacer spacer


                                                       
iPlanet International | Year 2000 | Site Map | Feedback
Products | Solutions | Support | Services | Download | About Us | Developer
© 2000 Sun-Netscape Alliance. All Rights Reserved  Privacy Policy