Method: Event#page

Defined in:
lib/source/redshift/event.rb

#pageObject

call-seq:

evnt.page -> {:x => numeric, :y => numeric}

Returns a hash representing evnt’s distance in pixels from the left (x) and top (y) edges of the current page, including pixels that may have scrolled out of view.

Document['#example'].listen(:click) {|element,event| puts event.page.inspect }

clicking element ‘#example’ at position (35,45) after scrolling down 100 pixels produces:

{:x => 35, :y => 145}


214
215
216
# File 'lib/source/redshift/event.rb', line 214

def page
  {:x => `this.__page__.x`, :y => `this.__page__.y`}
end