Skip to content

Instantly share code, notes, and snippets.

@tnog
tnog / reveal_ajax.js
Last active December 18, 2015 19:29 — forked from jeduan/reveal_ajax.js
(function($) {
$.fn.displayPost = function() {
event.preventDefault();
var post_id = $(this).data("id");
var id = "#" + post_id;
// Check if the reveal modal for the specific post id doesn't already exist by checking for it's length
if($(id).length == 0 ) {
// We'll add an ID to the new reveal modal; we'll use that same ID to check if it exists in the future.