Created
January 27, 2015 09:24
-
-
Save slifin/4386747f51b187ac4bbd to your computer and use it in GitHub Desktop.
JavaScript button on click handler for showing data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Read Book button. | |
*/ | |
$('.read-book-button').on('click', function(event){ | |
event.preventDefault(); | |
if ( !sameIds ) { | |
var id = $(this).data('id'); | |
$.ajax({ | |
type: 'post', | |
dataType: 'html', | |
url: sdesignsAjax.ajaxurl, | |
data: { | |
action : 'sdesigns_ajax_bookblock_function', | |
id : id, | |
sameIds : sameIds | |
}, | |
success: function(html) { | |
console.log('same ids false'); | |
ajaxSuccess(html); | |
$('#book-container').addClass('showBook'); | |
resizeBook(); | |
$(window).trigger('debouncedresize'); | |
} | |
}); | |
} else { | |
$('#book-container').addClass('showBook'); | |
resizeBook(); | |
$(window).trigger('debouncedresize'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment