Created
November 19, 2008 08:14
-
-
Save collin/26455 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment