Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (39 sloc) 1.57 KB
.clickme {
background: #AAA;
padding: 20px;
Press shift+a and there should appear some text below. Pressing it once again should not fire the event because of the <code>:once</code> pseudo.
<div id="result"><h3>keydown:keys(shift+a):once</h3></div>
<p class="clickme once">Clickme :once</p>
<div id="result2"></div>
<p id="throttle" class="clickme">:throttle(1000) - Click me quickly after each other. Event should fire 1 time / second</p>
<div id="result3"></div>
<p>Type something in the input field. The event should only fire once you have not typed for 300 ms</p>
<input type="text" id="pause" />
<div id="result4"></div>
<script src="/depender/build?require=More/Element.Event.Pseudos.Keys,More/Element.Delegation"></script>
var result = $('result'),
result2 = $('result2'),
result3 = $('result2'),
result4 = $('result2');
document.addEvent('keydown:keys(shift+a):once', function(){
result.set('html', result.get('html') + 'succes :keydown:keys(shift+a)!<br>');
document.addEvent('click:relay(p.once):once', function(event){
result2.set('html', result2.get('html') + 'succes :relay(p):once!<br>');
});'throttle').addEvent('click:throttle(1000)', function(event){
result3.set('html', result3.get('html') + 'succes :relay(p):throttle!<br>');
});'pause').addEvent('keydown:pause(300)', function(event){
result4.set('html', result4.get('html') + 'succes :pause(300)!<br>');
Jump to Line
Something went wrong with that request. Please try again.