Created — forked from jeduan/reveal_ajax.js

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Use Zurb reveal with ajax

View reveal_ajax.js
1 2 3 4 5 6 7 8
$('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();
});
});

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
Something went wrong with that request. Please try again.