?
Solved

how to determine what gerenated a automated click?

Posted on 2011-10-14
1
Medium Priority
?
175 Views
Last Modified: 2012-08-14
how to determine what keycode gerenated an automated click?

For example,

$("#container").click(function()
{


});

  ---- >>> from this point determine if the clicked came from keycode 40 or 38?

$(document).keydown(fucntion(e)
{
            if(keycode == 40)
            {
                    $("#container").trigger('click');
                    e.stopImmediatePropagation();
             }else if (keycode == 38)
              {
                     $("#container").trigger('click');
                     e.stopImmediatePropagation();
               }
});
0
Comment
Question by:areyouready344
1 Comment
 
LVL 83

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 36971569
check this page : http://api.jquery.com/trigger/

.trigger( eventType, extraParameters )

$("#container").click(function(e, p1)
{


});

  ---- >>> from this point determine if the clicked came from keycode 40 or 38?

$(document).keydown(function(e)
{
            if(keycode == 40)
            {
                    $("#container").trigger('click', [40]);
                    e.stopImmediatePropagation();
             }else if (keycode == 38)
              {
                     $("#container").trigger('click', [38]);
                     e.stopImmediatePropagation();
               }
});
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question