Method: Event#client
- Defined in:
- lib/source/redshift/event.rb
#client ⇒ Object
call-seq:
evnt.client -> {:x => integer, :y => integer}
Returns a hash representing evnt’s distance in pixels from the left (x) and top (y) edges of the browser viewport.
Document['#example'].listen(:click) {|element,event| puts event.client.inspect }
clicking element ‘#example’ at position (35,45) produces:
{:x => 35, :y => 45}
114 115 116 |
# File 'lib/source/redshift/event.rb', line 114 def client {:x => `this.__client__.x`, :y => `this.__client__.y`} end |