dojo
Version:
Dojo core is a powerful, lightweight library that makes common tasks quicker and easier. Animate elements, manipulate the DOM, and query with easy CSS syntax, all without sacrificing performance.
56 lines (50 loc) • 1.17 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title>dojo/behavior tests</title>
<link rel="stylesheet" href="../../resources/dojo.css">
</head>
<body>
<div class="foo" id="fooOne">
<span>.foo > span</span>
<div class="bar">
<span>.foo > .bar > span</span>
</div>
</div>
<!--for focus/topic tests -->
<input id="another" value="another">
<input type="text" id="blah" class="foo blah" name="thinger" value="thinger" tabIndex="0">
<script src="../../dojo.js" data-dojo-config="async: true, isDebug: true"></script>
<script>
var ready = false,
applyCount = 0,
topicCount = 0,
behaviorObject = {
'.bar':function(elem){
domStyle.set(elem, 'opacity', 0.5);
applyCount++;
},
'.foo > span':function(elem){
elem.style.fontStyle = 'italic';
applyCount++;
}
},
behavior,
domStyle;
require([
'dojo/behavior',
'dojo/dom-style',
'dojo/topic',
'dojo/domReady!'
], function (_behavior, _domStyle, topic) {
behavior = _behavior;
domStyle = _domStyle;
topic.subscribe('/foo', function () {
topicCount++;
});
ready = true;
});
</script>
</body>
</html>