From 3a2900ff645dc31fb25e879ec178b5ad3d79258d Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 22 Nov 2011 07:47:41 -0400 Subject: [PATCH] Use jQuery's live to lauch fancybox --- apps/main/templates/base.html | 50 ++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/apps/main/templates/base.html b/apps/main/templates/base.html index 1a656df0d7..99bf043b29 100644 --- a/apps/main/templates/base.html +++ b/apps/main/templates/base.html @@ -108,7 +108,7 @@ {% block web_theme_javascript %} - + @@ -126,24 +126,36 @@ }); }); - $("a.fancybox").fancybox({ - 'titleShow' : false, - 'transitionIn' : 'elastic', - 'transitionOut' : 'elastic', - 'easingIn' : 'easeOutBack', - 'easingOut' : 'easeInBack', - 'type' : 'image', - 'autoScale' : true - }); - $("a.fancybox-noscaling").fancybox({ - 'titleShow' : false, - 'transitionIn' : 'elastic', - 'transitionOut' : 'elastic', - 'easingIn' : 'easeOutBack', - 'easingOut' : 'easeInBack', - 'type' : 'image', - 'autoScale' : false - }); + jQuery("a.fancybox").live('click', function(){ + jQuery.fancybox({ + 'href' : $(this).attr('href'), + 'titleShow' : false, + 'transitionIn' : 'elastic', + 'transitionOut' : 'elastic', + 'easingIn' : 'easeOutBack', + 'easingOut' : 'easeInBack', + 'type' : 'image', + 'autoScale' : true + + }); + return false; + }); + + jQuery("a.fancybox-noscaling").live('click', function(){ + jQuery.fancybox({ + 'href' : $(this).attr('href'), + 'titleShow' : false, + 'transitionIn' : 'elastic', + 'transitionOut' : 'elastic', + 'easingIn' : 'easeOutBack', + 'easingOut' : 'easeInBack', + 'type' : 'image', + 'autoScale' : false + + }); + return false; + }); + $("a.fancybox-iframe").fancybox({ 'titleShow' : false, 'transitionIn' : 'elastic',