Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keyboard shortcuts with JavaScript
#4
I never used prototype, jquery is quite ok...
How much I've seen of prototype, I'm sure you can take the jquery code I've posted and convert it to prototype.
Where I call, $(".slide div:nth-child("+page+")").toggle();, you would need to get the href attribute of the element.
In jquery I would do something like this.
Code:
$(body).load($(".slide div:nth-child("+page+")").attr("href"));

As for what you found....

Code:
function add(a, b) {
    alert(parseInt(a) + parseInt(b));
}
Hotkeys.bind("alt+a", add, 3, 4);

This looks just like a plugin for jquery, with the same name.
I think you need to replace Hotkeys with an element, like in jquery, $(document).bind(); or just leave Hotkeys... what ever..
"alt+a" defines obviously the shortcuts, add is the function that processes the event, while 3 and 4 are passed as argument a and b to the function add.
Reply


Messages In This Thread
RE: Keyboard shortcuts with JavaScript - by Gaijin - 04-15-2011, 11:03 AM
RE: Keyboard shortcuts with JavaScript - by Gonzo - 04-18-2011, 07:10 PM
RE: Keyboard shortcuts with JavaScript - by Danny - 05-07-2011, 01:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Free Worker HTML, CSS, Javascript ImFocuzz 2 1,281 04-05-2014, 10:01 PM
Last Post: VHPanda
  [MyBBError Message] PLEASE HELP ME!! Enable Javascript Registration Error iRun 4 1,921 01-26-2012, 03:13 PM
Last Post: iRun
  Close Tab With Javascript. Qua 3 1,410 07-02-2011, 07:25 AM
Last Post: djakariuz
  Javascript Help. Form Submission. JohnRonder 0 890 02-01-2011, 11:12 AM
Last Post: JohnRonder
  [javascript] Link of Minute zone 3 1,093 12-11-2009, 02:16 AM
Last Post: Sagittarius

Forum Jump:


Users browsing this thread: 9 Guest(s)