def opacity_tag(name, options = nil, &block) opacity = options.has_key?(:opacity) ? options.delete(:opacity) : 0.75 opacity /= 100.0 if opacity >= 1 style = options[:style] || '' options[:style] = "#{style}; filter:alpha(opacity=#{(opacity * 100).to_i}); -moz-opacity:#{opacity}; opacity:#{opacity};" content = capture(&block) concat(content_tag(name, content, options), block.binding) end