when fancyBox is closed, another div should fadeIn [solved]

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

when fancyBox is closed, another div should fadeIn [solved]

Post by macangelo »

Hi

I want to write a function that detects when the fancyBox is closed and then fades-in a div container with the id "xyz".

I tried this, but it doesn't work. Can anybody help?

$(document).ready(function(){
$(window).bind("beforeunload",
function() {
$("div#xyz").fadeIn("slow");
});
});
thanks a lot

macangelo
Last edited by macangelo on Sat 8. Mar 2014, 18:41, edited 2 times in total.
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: when fancyBox is closed, another div should fadeIn

Post by Oliver Georgi »

That is the wrong way. Have a look: http://jsfiddle.net/slackero/d6TeL/4/

If you use the phpwcms-fancyBox you have to implement this to jquery.fancybox.initSwipeOn.js or jquery.fancybox.initSwipeOff.js
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

Re: when fancyBox is closed, another div should fadeIn

Post by macangelo »

Hi

Thanks a lot. It works fine! Here's the complete code I put in the html-content part (if my client approves I'll later put the frontend view here):

Code: Select all

<!-- JS: $(document).ready(function() {
        var $showMe = $('#aktuelleAngebote');
	$(".various").fancybox({
		maxWidth	        : 850,
		maxHeight  	: 700,
		fitToView	        : false,
		width		: '70%',
		height		: '70%',
		autoSize	        : false,
		closeClick	        : false,
		openEffect	: 'none',
		closeEffect	: 'none',
                loop                  : false,
                beforeLoad       : function() {
		                               $showMe.fadeOut('fast');
                                         },
                afterClose         : function(current, previous) {
                                                $showMe.fadeIn('slow');
                                          }
         });
});
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
Post Reply