Yahoo! UI Library - Drag and Drop 5 : Drag Drop « GUI Components « JavaScript DHTML

Yahoo! UI Library - Drag and Drop 5

  <!doctype html public "-//W3C//DTD HTML 4.01//EN" "">
<title>Yahoo! UI Library - Drag and Drop</title>
<link rel="stylesheet" type="text/css" href="./examples/dragdrop/css/screen.css">
<script type="text/javascript" src="./build/yahoo/yahoo.js" ></script>
<script type="text/javascript" src="./build/event/event.js" ></script>
<script type="text/javascript" src="./build/dom/dom.js"></script>
<script type="text/javascript" src="./build/logger/logger.js"></script>

<script type="text/javascript" src="./build/dragdrop/dragdrop-debug.js" ></script>
<script type="text/javascript" src="./examples/dragdrop/js/DDOnTop.js" ></script>

<script type="text/javascript">

YAHOO.example.DDApp = function() {
    var dd, dd3, logger;
    return {
        init: function() {
            dd = new YAHOO.example.DDOnTop("dragDiv1");
            dd3 = new YAHOO.util.DDTarget("dragDiv3");
} ();
YAHOO.util.Event.addListener(window, "load", YAHOO.example.DDApp.init);
<div id="pageTitle">
    <h3>Drag and Drop - DD, DDTarget</h3>

<style type="text/css">

/* logger default styles */
/* font size is controlled here: default 77% */
#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;}
/* width is controlled here: default 31em */
.yui-log {background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;}
.yui-log p {margin:1px;padding:.1em;}
.yui-log button {font-family:monospace;}
.yui-log .yui-log-hd {padding:.5em;background-color:#575757;color:#FFF;}
/* height is controlled here: default 20em*/
.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}
.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;}
.yui-log .yui-log-ft .yui-log-categoryfilters {}
.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}
.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}
.yui-log .yui-log-filtergrp {margin-right:.5em;}
.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */
.yui-log .warn {background-color:#F58516;} /* F58516 orange */
.yui-log .error {background-color:#E32F0B;} /* E32F0B red */
.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */
.yui-log .window {background-color:#F2E886;} /* F2E886 tan */

<img id="ylogo" src="./examples/dragdrop/img/logo.gif" />

<div id="container">
<div id="containerTop">
<div id="header">
<div id="main">

<div id="rightbar">

<div id="rightBarPad">
<script type="text/javascript">
    YAHOO.example.logApp = function() {
        return {
            init: function() {
                if (YAHOO.widget.Logger) {
                    var reader = new YAHOO.widget.LogReader( "logDiv", 
                            { newestOnTop: true, height: "400px" } );

                    reader._onClickPauseBtn(null, reader);

    } (); 

    YAHOO.util.Event.on(window, "load", YAHOO.example.logApp.init);

<div id="logDiv"></div>


  <div id="content">
    <form name="dragDropForm" action="javscript:;">
    <div class="newsItem">
      <h3>Multiple Drag Handles</h3>
<strong>The logger is paused for performance reasons.  Click "Resume" to re-enable it.</strong>

      <div id="footerContainer">
        <div id="footer">

    <div id="dragDiv1" style="position:absolute;color:white;background-color:#594178;top:240px; left:105px;height:200px;width:200px;z-index:2;padding:4px">
        <div id="handle1" style="text-align:center;margin-right:14px;cursor:move;float:left;color:black;width:90px;background-color:#eeeeee;border:1px solid black ">handle1</div>
        <div id="handle2" style="text-align:center;cursor:move;float:right;color:black;width:90px;background-color:#eeeeee;border:1px solid black ">handle2</div>
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris nec turpis. Vestibulum gravida suscipit libero. Integer id sapien. Nullam tempus, lorem quis rutrum consectetuer, erat massa vehicula nisl, eu pulvinar lacus diam ac orci

    <div id="dragDiv3" class="testSquare" style="background-color:#000000;top:460px; left:325px;cursor:default;z-index:0">DDTarget</div>

       3,714 k)

Related examples in the same category

1.DynAPI Examples - Drag Drop /w Collision Detection
2.Display Drag Icon in drag and drop
3.Drag Over Event: Drag and Drop the file over recycle bins
4.Yahoo! UI Library - Drag and Drop 1
5.Yahoo! UI Library - Drag and Drop 2
6.Yahoo! UI Library - Drag and Drop 3
7.Dragged object is on top
8.Drag and Drop - DDProxy
9.Yahoo! UI Library - Drag and Drop: Resize
10.Drag and Drop: Multiple groups, targetable affordance
11.Drag and Drop to sort slides
12.Drag and Drop to sort lists
13.Drag inside and outside a range
14.Drag still
15.Crop an image
16.Drag and drop custom window with title bar
17.Dragable float window with scrollable text inside
18.Dragable transparent window
19.Drag within a range 2
20.Dragable sorted list
21.Dragable and sortable toolbar