Solved

Pause Jquery Cycle when Fancybox opened

Posted on 2010-09-03
3
1,509 Views
Last Modified: 2012-05-10
Hi,

I have a little issue with my site that I cannot solve. you can see the issue at conceptparadise.com/dm The problem is that when I open a flash animation in fancybox over the top of jquery cycle, the flash animation stahhers when the banners in the background rotate.

What I am trying to do and failing at it pausing the cycle plugin when the fancybox is opened and then resuming the cycle plugin once fancybox is closed.

I have attached the two example of code that I have at the moment and where i have got to. What I am going is probably wrong!!!

I would really appreciate any help that anyone could give me as I am going crazy with this..

Thank you in advance
<!-- Banner Rotator -->    
 <script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.74.js"></script>
<script type="text/javascript">
$(function() {
    $('#s3').cycle({fx: 'fade',speed: 1500 });
});
/*
$('#pauseButton').click(function() { 
    $('#s3').cycle('pause'); 
});
$('#resumeButton').click(function() { 
    $('#s3').cycle('resume', true); 
});
*/
$('#fancybox-wrap').show('slow', function() {
	alert('fancybox show');
    $('#s3').cycle('pause'); 
});
$('#fancybox-wrap').hide('slow', function() { 
    $('#s3').cycle('resume', true); 
});
</script>


<!-- Example of Fancybox call -->

$("#Dentiframe4buttons1").fancybox({
				'width':700, 
				'height':405,		
				'type':'iframe', 
				'autoScale':'false' 
			});

Open in new window

0
Comment
Question by:flashjordan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
kadaba earned 500 total points
ID: 33602312
like this....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Fancybox Jquery Cycle Combined</title>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
	<script type="text/javascript" src="http://fancybox.net/js/fancybox/jquery.easing-1.3.pack.js"></script>
	<script type="text/javascript" src="http://fancybox.net/js/fancybox/jquery.mousewheel-3.0.2.pack.js"></script>
	<script type="text/javascript" src="http://fancybox.net/js/fancybox/jquery.fancybox-1.3.1.pack.js"></script>
	<script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.72.js"></script>

	<link rel="stylesheet" href="http://fancybox.net/js/fancybox/jquery.fancybox-1.3.1.css" type="text/css" media="screen" />
	
	<script type="text/javascript">
		$(document).ready(function() {

			$("#various6").fancybox({
				'width':700, 
				'height':405,		
				'type':'iframe', 
				'autoScale':'false',
				'onStart': pauseCycle,
				'onClosed': resumeCycle				
			});
			
			$('#s6').cycle({ 
				fx:    'fade', 
				speed:  2500 
			 })
			
		});
	
		function pauseCycle(){
			$('#s6').cycle('pause');
		}
		function resumeCycle(){
			$('#s6').cycle('resume'); 
		}
	</script>
	<style type="text/css">
		.pics {  
			height:  232px;  
			width:   232px;  
			padding: 0;  
			margin:  0;  
		} 
		 
		.pics img {  
			padding: 15px;  
			border:  1px solid #ccc;  
			background-color: #eee;  
			width:  200px; 
			height: 200px; 
			top:  0; 
			left: 0 
		} 
	</style>
</head>
<body>
<div id="s6"class="pics"> 
    <img src="http://www.topnews.in/files/GoogleCL.jpg" width="200" height="200" /> 
    <img src="http://cdn.lastclicknews.com/wp-content/uploads/2010/04/Bing-Logo.jpg" width="200" height="200" /> 
    <img src="http://nfsmi-web01.nfsmi.olemiss.edu/adobe-logo.jpg" width="200" height="200" /> 
</div> 
<ul>
	<li><a id="various6" href="http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf">Swf</a></li>
</ul>
</body>
</html>

Open in new window

0
 
LVL 1

Author Closing Comment

by:flashjordan
ID: 33602825
That is amazing, if I could give you more points I would as you have solved somethi9ng that has been causing me nightmares... Thank you so much!!!
0
 
LVL 22

Expert Comment

by:kadaba
ID: 33602878
Thank you :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question