Skip to content

Commit

Permalink
fixing demos
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbmeyer committed Feb 24, 2012
1 parent 8fa6e3c commit 1b85f8a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
54 changes: 28 additions & 26 deletions event/drop/drop.html
Expand Up @@ -41,33 +41,35 @@ <h2>Dropmove/Dropon</h2>
<span>Drop Count <span class='count'>0</span></span>
</div>
<script type='text/javascript'
src='../../../steal/steal.js?jquery/event/drop'
id='demo-source'>
//make drags
$('.handle').live("draginit", function(){})

//add dropout/dropover
$('#dropout')
.delegate(".dropout","dropover", function(){ $(this).addClass('over') })
.delegate(".dropout","dropout", function(){ $(this).removeClass('over') })
.bind("dropover", function(){ $(this).addClass('over') })
.bind("dropout", function(){ $(this).removeClass('over') });

//turn off dropout/dropover
$("#undelegate").click(function(){
$('#dropout').undelegate(".dropout","dropover");
$('#dropout').undelegate(".dropout","dropout");
src='../../../steal/steal.js'></script>
<script type='text/javascript' id='demo-source'>
steal('jquery/event/drop', function(){
//make drags
$('.handle').live("draginit", function(){})

//add dropout/dropover
$('#dropout')
.delegate(".dropout","dropover", function(){ $(this).addClass('over') })
.delegate(".dropout","dropout", function(){ $(this).removeClass('over') })
.bind("dropover", function(){ $(this).addClass('over') })
.bind("dropout", function(){ $(this).removeClass('over') });

//turn off dropout/dropover
$("#undelegate").click(function(){
$('#dropout').undelegate(".dropout","dropover");
$('#dropout').undelegate(".dropout","dropout");
})

//add dropmove/dropon
var count = 0
$('.dropmove')
.bind('dropmove', function(){
$('.count').text(count++)
})
.bind('dropon', function(){
$(this).text("Dropped on!")
})
})

//add dropmove/dropon
var count = 0
$('.dropmove')
.bind('dropmove', function(){
$('.count').text(count++)
})
.bind('dropon', function(){
$(this).text("Dropped on!")
})
</script>
</body>
</html>
8 changes: 5 additions & 3 deletions event/hover/hover.html
Expand Up @@ -32,11 +32,12 @@ <h4>HoverLeave</h4>
<div class='hoverleave'>Leave and don't return for a half second</div>
</div>
<script type='text/javascript'
src='../../../steal/steal.js?jquery/event/hover'></script>
src='../../../steal/steal.js'></script>

<script type="text/javascript" id="demo-source">
steal().then(function(){


steal('jquery/event/hover', function(){

// adds a hover class
var add = function(ev){
$(this).addClass("hoverstate");
Expand All @@ -63,6 +64,7 @@ <h4>HoverLeave</h4>
}).bind('hoverenter',add).bind('hoverleave', remove);

});

</script>
</body>
</html>

0 comments on commit 1b85f8a

Please sign in to comment.