jQuery Simulate Extended Plugin
Demo of the jQuery simulate extended plugins. http://github.com/j-ulrich/jquery-simulate-ext
by bizamajig
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/themes/ui-lightness/jquery-ui.css">
<script src="http://j-ulrich.github.com/jquery-simulate-ext/jquery.simulate.js"></script>
<script src="http://j-ulrich.github.com/jquery-simulate-ext/jquery.simulate.ext.js"></script>
<script src="http://j-ulrich.github.com/jquery-simulate-ext/bililiteRange.js"></script>
<script src="http://j-ulrich.github.com/jquery-simulate-ext/jquery.simulate.key-sequence.js"></script>
<script src="http://j-ulrich.github.com/jquery-simulate-ext/jquery.simulate.key-combo.js"></script>
<script src="http://j-ulrich.github.com/jquery-simulate-ext/jquery.simulate.drag-n-drop.js"></script>
<textarea id="textInput"></textarea>
<div id="slider"></div>
<div id="buttonbox">
<button id="key-sequence">Simulate key-sequence</button>
<button id="key-combo">Simulate key-combo</button>
<button id="drag-n-drop">Simulate drag-n-drop</button>
</div>
CSS
#textInput {
height: 5em;
width: 30em;
margin: 1em;
}
#slider {
margin: 1em;
width: 30em;
}
#buttonbox {
margin: 1em;
margin-top: 3em;
}
JavaScript
$('#slider').slider();
$('#key-sequence').click(function() {
$('#textInput').simulate("key-sequence", {sequence: "foobar"});
});
$('#key-combo').click(function() {
$('#textInput').simulate("key-combo", {combo: "shift+a"});
});
$('#drag-n-drop').click(function() {
$('#slider .ui-slider-handle').simulate("drag-n-drop", {dx: 300, interpolation: {stepWidth: 10, stepDelay: 50}});
});