Method: Situated::Element#scroll
- Defined in:
- lib/source/redshift/situated.rb
#scroll ⇒ Object
call-seq:
situated.scroll -> hash
returns a hash containing keys <tt>:x<tt> and <tt>:y<tt> representing the the distance that a situated has been scrolled originating at the top left corner of the situated
For example if a situated has been scrolled 10px left and 5px down situated.scroll #=> => 10, :y => 5
90 91 92 93 |
# File 'lib/source/redshift/situated.rb', line 90 def scroll return self.window.scroll if self.is_body? return {:x => `#{self}.__native__.scrollLeft`, :y => `#{self}.__native__.scrollTop`} end |