I am using jQuery draggable to drag separate letters of the word "Hello" across the screen, but I've noticed annoying behavior.
If I drag the letter H to the right, anywhere near the letters E, L, L, or O, and then drop the letter, I can no longer "pick-up" the letter because it is now "trapped under" the other letters' h1 (I wrapped each letter in a separate h1). The same goes for any other letter that is considered to be "below" the other (H being the "lowest" and O being the "highest").
It's difficult to explain so I'm including a fiddle to illustrate. Drag the letter "H" right above the letter "E" (not on top of), let go, then try to pick it back up again and you won't be able to (until you move the "E" out of the way). I put a border around each h1 so that you could see that it is the h1 that is somehow blocking me from picking up the letter.
The weird thing is that this only happens in Chrome. I've tested it in IE10 on Win 7 and it's fine.
Any ideas on how to fix it?
HTML:
<body>
<div id="name">
<h1 id="h" ><a href=#>H</a></h1>
<h1 id="e" ><a href=#>E</a></h1>
<h1 id="l" ><a href=#>L</a></h1>
<h1 id="l2" ><a href=#>L</a></h1>
<h1 id="o" ><a href=#>O</a></h1>
</div>
</body>
CSS:
body {
font-family: 'Sigmar One', cursive;
font-size: 75px;
color: white;
text-shadow: 5px 5px 5px #000;
background-color:blue;
width: 100%;
height: 100%;
margin: 0;
}
div {
position:absolute;
height:100%;
width: 100%;
display: table;
}
h1 {
display: table-cell;
vertical-align: middle;
text-align:center;
height: 1em;
border: 1px solid black;
}
a {
/*border: 1px solid black;*/
display: inline-block;
line-height: 100%;
overflow: hidden;
}
a:visited, a:hover, a:active {
text-decoration: none;
color: white;
}
a:link {
text-decoration: none;
color: white;
text-shadow: 3px -3px 0px black;
}
a:hover {
text-shadow: 5px 5px 5px #000;
color: white;
}
jQuery:
$(document).ready(function() {
$("#h, #e, #l, #l2, #o").draggable({ handle: "a" });
});
Fiddle: http://jsfiddle.net/8Huu7/36/