Skip to content

Instantly share code, notes, and snippets.

@kedarmhaswade
Created March 17, 2013 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kedarmhaswade/5181460 to your computer and use it in GitHub Desktop.
Save kedarmhaswade/5181460 to your computer and use it in GitHub Desktop.
Making data-remote=true link behave as such, but only once!
var j = jQuery.noConflict();
j("body").append("<%= escape_javascript(render :partial => 'problems/problem_gallery_carousel')%>");
j("#show-problem-gallery-link").unbind();
j("#show-problem-gallery-link").attr("data-remote", "false"); //no Ajax anymore
j("#show-problem-gallery-link").click(function() { //attach a JS-only event handler
j("#problem-gallery-carousel").carousel({interval: false});
j("#problem-gallery-modal").modal('show');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment