Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'redshift'
- class JQuery < Array
- def initialize selector
- @els = Document[selector]
- end
- def each &block
- @els.each &block
- return this
- end
- def hide
- each{|el| el.styles[:display] = 'none' }
- end
- def show
- each{|el| l.styles[:display] = '' }
- end
- end
- def q selector, &block
- JQuery.new selector, &block
- end
- Document.ready? do
- q('.fields > li').hide
- end
Add Comment
Please, Sign In to add comment