halt.html revision 1b298c6f0ef597aa4ab0b8bcb25430b6c9a87749
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<html>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<head>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <title>YUI: 3.x Event Halt</title>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <link rel="stylesheet" type="text/css" href="/yui-dev/build/reset-fonts-grids/reset-fonts-grids.css">
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <style type="text/css" media="screen">
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte p, h2 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte margin: 1em;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte #anim {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte background-color: #ccc;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte border: 1px solid black;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte height: 100px;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte width: 100px;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte strong { font-weight: bold; }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte </style>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte</head>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<body class="yui-skin-sam">
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<div id="doc3" class="yui-t7">
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <div id="hd">YUI: 3.x Event Halt</div>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <div id="bd">
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <p>This test case shows that calling halt on an event will stop all events, not just those associated with the event.</p>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <p>If you click the <strong>[Click Me]</strong> link below, the animation will <strong>NOT</strong> run. It calls <strong>e.halt()</strong> before the animation.</p>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <p><a href="index.php">[Click here to see the working case]</a></p>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <a href="#" id="test">[Click Me]</a>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <div id="anim">
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte I am Animated
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte </div>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte </div>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte <div id="ft">&nbsp;</div>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte</div>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<script type="text/javascript" src="/build3x/yui/yui.js?bust=1216406682"></script>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<!-- needed until built into a module -->
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<script type="text/javascript" src="/build3x/attribute/attribute.js?bust=1216406682"></script>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<script type="text/javascript" src="/build3x/base/base.js?bust=1216406682"></script>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<!-- needed until new node.js is built into yui.js -->
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<script type="text/javascript" src="/build3x/animation/animation.js?bust=1216406682"></script>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<script>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevar yConfig = {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte logExclude: {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte 'YUI': true,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Event: true,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Base: true,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Attribute: true,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte augment: true
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte },
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte debug: false
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevar Y = new YUI(yConfig).use('nodeextras', 'base', 'animation');
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteY.on('event:ready', function() {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Y.Node.get('#test').on('click', function(e) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte console.log('#test clicked..');
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte console.log('calling event.halt() before anim..');
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte e.halt();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte var anim = new Y.Anim({
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte node: '#anim',
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte to: {
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe height: 200,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte width: 200
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte },
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte from: {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte height: 100,
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe width: 100
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe },
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte duration: 1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iteration: 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte });
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte anim.run();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte });
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte});
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte</script>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte</body>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte</html>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<!-- lifeagree.corp.yahoo.com compressed/chunked Fri Jul 18 11:44:42 PDT 2008 -->
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte