source: cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/examples/node/basic-node_clean.html @ 5259

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/examples/node/basic-node_clean.html@5259
Revision 5259, 1.7 KB checked in by domlowe, 11 years ago (diff)

adding yui javascript

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4<meta http-equiv="content-type" content="text/html; charset=utf-8">
5<title>Node Basics</title>
6
7<style type="text/css">
8/*margin and padding on body element
9  can introduce errors in determining
10  element position and are not recommended;
11  we turn them off as a foundation for YUI
12  CSS treatments. */
13body {
14        margin:0;
15        padding:0;
16}
17</style>
18
19<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" />
20<script type="text/javascript" src="../../build/yui/yui-min.js"></script>
21
22
23<!--begin custom header content for this example-->
24<link href="assets//node.css" rel="stylesheet" type="text/css">
25
26<!--end custom header content for this example-->
27
28</head>
29
30<body class=" yui-skin-sam">
31
32<h1>Node Basics</h1>
33
34<div class="exampleIntro">
35        <p>This example demonstrates how to <code>get</code> and use a <code>Node</code> instance to access DOM properties.</p>
36<p>Click the box to update the <code>innerHTML</code> of the element.</p>
37                       
38</div>
39
40<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
41
42<div id="demo">
43    <p>Whose child am I?</p>
44</div>
45
46<script type="text/javascript">
47YUI({base:"../../build/", timeout: 10000}).use("node-base", function(Y) {
48    var node = Y.get('#demo p');
49
50    onClick = function(e) {
51        var node = e.currentTarget;
52        var html = 'I am a child of ' + node.get('parentNode').get('id') + '.';
53        node.set('innerHTML', html);
54    };
55
56    node.on('click', onClick);
57});
58
59</script>
60
61<!--END SOURCE CODE FOR EXAMPLE =============================== -->
62
63</body>
64</html>
65<!-- delightfuture.corp.yahoo.com uncompressed/chunked Wed Aug 13 16:45:33 PDT 2008 -->
Note: See TracBrowser for help on using the repository browser.