$(document).ready(function(){ var larghezza = parseInt(Drupal.settings.msgmodalframe.width); var altezza = parseInt(Drupal.settings.msgmodalframe.height); $('.normalbox').click(function(){ var title= $(this).attr('title'); var modalOptions = { //url: $(this).attr('href')+'?child=true', autoFit: true, width: larghezza, height:500, onSubmit: onSubmitCallbackExample, title:title, dialogClass :"modalframe" }; // Open the modal frame dialog. var win = $(""); var ifra = $(""); ifra.css({ "width":larghezza, "height":altezza }); win.append(ifra); $('body').append(win); win.dialog(modalOptions); // Prevent default action of the link click event. return false; }); /** apre con stile modalframe i link con classe modalbox **/ $('.modalbox').click(function() { // Build modal frame options. var modalOptions = { url: $(this).attr('href')+'?child=true', autoFit: true, width: larghezza, height: altezza, onSubmit: onSubmitCallbackExample }; // Open the modal frame dialog. Drupal.modalFrame.open(modalOptions); // Prevent default action of the link click event. return false; }); /** apre con stile modalframe anche i link con classe ingrandisci-img **/ $('.ingrandisci-img').click(function() { // Build modal frame options. var modalOptions = { url: $(this).attr('href')+'?child=true', autoFit: true, width: larghezza, height: altezza, onSubmit: onSubmitCallbackExample }; // Open the modal frame dialog. Drupal.modalFrame.open(modalOptions); // Prevent default action of the link click event. return false; }); /** apre con stile modalframe anche i link con classe popup-img **/ $('a.popup-img').click(function() { // Build modal frame options. var Options = { url: $(this).attr('href')+'?child=true', autoFit: true, width: 500, onSubmit: onSubmitCallbackImg }; // Open the modal frame dialog. Drupal.modalFrame.open(Options); // Prevent default action of the link click event. return false; }); function onSubmitCallbackImg(args, statusMessages) { $('body').removeClass('modalframe-img-open'); } $('.popup-img').click(function() { $('body').addClass('modalframe-img-open'); }); function onSubmitCallbackExample(args, statusMessages) { $('body').removeClass('modalframe-open'); } $('.modalbox').click(function() { $('body').addClass('modalframe-open'); }); }); // end document.ready