i try to flip a modal dialog of jquery with flippy plugin
Here my code for create the dialog :
$(document).ready(function(){
[...]
$('<div class="modal-popup"><div>TEST</div></div>')
.hide() // Hide the dialog for now so we prevent flicker
.appendTo(document.body)
.filter('div') // Filter for the div tag only, script tags could surface
.dialog({ // Create the jQuery UI dialog
create: function () {
$(this).parent().wrap('<div class="flip" style="border:1px solid red;position:relative;z-index:50000;" />');
},
title: link.data('dialog-title'),
dialogClass: "dialog_shadow",
modal: true,
resizable: false,
draggable: true,
show: { effect: 'fade', duration: 250 },
hide: { effect: 'fade', duration: 400 },
width: 'auto',
beforeClose: function () {
resetForm($(this).find('form'));
$('input[type=submit]').css('cursor', 'hand');
}
})
.end();
});
When the dialog appear and when i click on a link, i flip the dialog and i display the same content with this code :
$('.popCallActionRegister > a').click(function (e) {
e.preventDefault();
var content = $('div.flip').html(); // ModalDialog -> div.ui-dialog all html
$('div.flip').flippy({
verso: content,
direction: "LEFT",
duration: "250"
});
});
That work very well but i lost all Javascript in my content and i can't drag my dialog., the call ajax don't work in my new flipped content
How i can keep my javascript active ? Because it's the same content and i just do a flip...That's all.
UPDATE :
HERE jsFiddle
this solution integrate the propositions below
Any help will be appreciated !