module Apotomo::JavascriptGenerator::Jquery

Public Instance Methods

animate(id, markup) click to toggle source
# File lib/apotomo-animate/javascript_generator.rb, line 22
def animate(id, markup)
  wrapped_markup = "<div id=\"wrapper-#{id}\" style=\"opacity: 0\">#{markup}</div>"

  "#{element(id)}.replaceWith('#{escape(wrapped_markup)}');" +
  "#{element("wrapper-#{id}")}.animate({ 'opacity': 1}, 400);"
end
animate_id(id, markup) click to toggle source
# File lib/apotomo-animate/javascript_generator.rb, line 28
def animate_id(id, markup)
  animate("##{id}", markup)
end