Permalink
Browse files

Playing around with jQuery stuff...

  • Loading branch information...
1 parent c85afeb commit 0f409f20d9fcaacfe358d1510809a0bef077d3b5 @kto committed Dec 19, 2010
Showing with 25 additions and 10 deletions.
  1. +25 −10 index.html
View
@@ -10,23 +10,32 @@
<script src="development-bundle/ui/jquery.ui.mouse.js"></script>
<script src="development-bundle/ui/jquery.ui.draggable.js"></script>
+ <script src="development-bundle/ui/jquery.ui.accordion.js"></script>
<link rel="stylesheet" href="development-bundle/demos/demos.css">
<style>
.draggable { width: 100px; height: 100px; padding: 0.4em; float: left; margin: 0;}
.draggable h3 { margin: 0; padding: 0.4em; font-weight: bold; cursor: move; position: relative; text-align:center;}
-
+ .menuitem { font-size: 8pt; font-family: arial; font-weight: bold; }
</style>
<script type="text/javascript">
var count = 0;
$(function(){
- $( "#draggable" ).draggable({ handle: "h3" });
- $( "#draggable2" ).draggable({ handle: "h3" });
+ $( "#menu" ).draggable();
$( "div, h3" ).disableSelection();
+ $( "#accordion" ).accordion({
+ collapsible: true
+ });
+
+ jQuery(document).ready(function(){
+ $( "#accordion" ).accordion("activate", false);
+ });
+
+
function addNewNote(x, y) {
@@ -36,10 +45,11 @@
count++;
}
- $( "#content" ).click(function(e) {
+ $( "#newprivate" ).click(function(e) {
var x = e.pageX;// - this.offsetLeft;
var y = e.pageY;// - this.offsetTop;
addNewNote(x, y);
+ $( "#accordion" ).accordion("activate", false);
return false;
});
@@ -50,13 +60,18 @@
</script>
</head>
<body>
- <div id="content" style="position: relative; top: 0; left: 0; width: 100%; height: 200px; background-color: #f5f5f5;">
+ <div id="content">
&nbsp;
- <div id="draggable" class="ui-widget-content ui-corner-all draggable">
- <h3 class="ui-widget-header ui-corner-all">New note</h3>
- Lorem ipsum laardi laardi laah
- </div>
-
+ <div id="menu" class="ui-widget-content ui-corner-all ui-draggable draggable" style="border: 0">
+ <div id="accordion" style="position: absolute; width: 130px; ">
+ <h3><a href="#">New...</a></h3>
+ <div>
+ <a href="#" id="newprivate" class="menuitem">Private note</a><br><br>
+ <a href="#" class="menuitem">Shared note</a><br><br>
+ <a href="#" class="menuitem">Public note</a>
+ </div>
+ </div>
+ </div>
</div>
</body>

0 comments on commit 0f409f2

Please sign in to comment.