Skip to content

Instantly share code, notes, and snippets.

@ericcholis
Forked from jeduan/reveal_ajax.js
Created October 23, 2012 12:01
Show Gist options
  • Save ericcholis/3938397 to your computer and use it in GitHub Desktop.
Save ericcholis/3938397 to your computer and use it in GitHub Desktop.
Use Zurb reveal with ajax
$('a.reveal').click(function(event) {
event.preventDefault();
var $div = $('<div>').addClass('reveal-modal').appendTo('body'),
$this = $(this);
$.get($this.attr('href'), function(data) {
return $div.empty().html(data).append('<a class="close-reveal-modal">&#215;</a>').reveal();
});
});
@interactiveoms
Copy link

Hello, I am not 100% sure if this will work for what I am doing because I'm mor of a hack than a programmer, but I am trying to load an ajax form response into a Zurb Reveal modal after a form submission (the form is in the reveal window, and I want the response back in the same reveal) - should this do the trick? If so, would you mind taking a quick gander at what I've done and letting me know what the heck I've missed?

The page I'm using it on is here: http://tinyurl.com/99c9krn - just go down the page to the green bar that has a button that says "find out more" - when you click on that it launches the form in a reveal window...

Any help would be highly appreciated!
Greg Thibodeaux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment