Skip to content

Instantly share code, notes, and snippets.

View dandean's full-sized avatar
🌧️
It's raining.

Dan Dean dandean

🌧️
It's raining.
View GitHub Profile
@dandean
dandean / gist:313617
Created February 24, 2010 17:01 — forked from gf3/gist:143893
Many times, when creating a site, I need hidden elements on a page that I must later make visible. Of course it would
be great if one could simply hide them via CSS, and later [easily] show them via javascript. However this is not the
case, javascript has some difficulties overriding styles set in a stylesheet. So, I've found the best way to
accomplish this is to use a combo of CSS and javascript in a two-step process:
1. Hide the elements via CSS class – so they are hidden when the user first sees the page
2. Hide the elements via javascript and remove the corresponding CSS class, after the DOM has loaded.
The second step has the potential to be quite expensive on the DOM, but I feel that it's an acceptable trade-off
because the elements in question are already hidden. This way they are ready to be manipulated, one doesn't need to
require 'net/dns/resolver'
# Custom Domain
#
# Require net-dns gem
#
# A Rack middleware to to resolve the custom domain to original subdomain
# for your multi telent application.
#
# It's all transperant to your application, it performs cname lookup and