CYCLE PLUGIN - triggering function on specific slide with keyboard shortcut
Hello
i have some spans that are displayed by cycle plugin
<span class="ban">a</span>
<span class="ban">b</span>
<span class="ban">c</span>
etc
i use the function to modify currently displayed slide on mouse click
- <script>
- function selecta(){
- $("span").click(function () {
- $(this) .toggleClass("dunno");
- $(this) .clone() .appendTo("#buffer");
- });
-
- };
- </script>
I would like to do it with keyboard rather than mouse.
But then I have problem with triggering
function only in the currently displayed slide
I tried this for ENTER key but failed:
- function selecta() {
- $('span').bind('keydown', function(e) {
- if(e.keyCode==13)
- $(this) .toggleClass("dunno");
- $(this) .clone() .appendTo("#buffer");
-
- });
- }
Thanks in advance for the suggestions.