title: calling a jquery function and passing it an object on arrow keypress
body: <p>Trying to call a function "clickEvent()" and pass it an obj with attributes on arrow-keyUp using jQuery. But Im not reaching the function. Here is the code. Thanks.</p>
  
  <p><strong>Please Note: Im forking existing code, but adding my arrowPress events to it. So everything should remain as is expect for the document ready if (direction != null) area.</strong></p>
  
  <pre><code>$(document).ready(function() {
      $('body').keyup(function(event) {
          var direction = null;
  
          // handle cursor keys
          if (event.keyCode == 37) {
              // slide left
              direction = 'prev';
          } else if (event.keyCode == 39) {
              // slide right
              direction = 'next';
          }
  
          if (direction != null) {
              //alert($('.'+ direction).attr('rel'));
              //need to pass the alert above as an obj to the function clickEvent() below.
          }
      });
  
  }); //end $(document).ready
  
  
  //function on external .js src
  (function($) {
      function clickEvent(obj) {
          alert(obj.attr("rel"));
      }
  
      $.fn.slidingPage = function(options) {
          $el = $(this);
      }
  })(jQuery); //end ext js scr
  </code></pre>