Jump to content

How remove fancybox within of a js function


seok

Recommended Posts

Hi all

 

I added a code in product.js to show arrows with links to get next and previous product images in mobile device.

It is working but the problem is that this function is working with fancybox and I dont know how remove it.

I know what if I uncomment fancybox function in product.js then it is not working but I want remove only fancybox for this function in mobile resolution because I want fancybox in standard resolution. This is my code:

		$("#image-block").on("click", ".slick-arrow", function(e) {

			e.preventDefault();
			var direction = $(this).data('role');

			if(direction == 'next'){
				imageswap = $('#thumbs_list').find('.shown').parent().nextAll('li:visible').first().find('a');
				if (!imageswap.length)
					imageswap = $('#thumbs_list').find('a:visible').first();
				imgrepl = imageswap.find('img');
				
				//$(imageswap).addClass('shown');
			}
			else if(direction == 'prev'){
				imageswap = $('#thumbs_list').find('.shown').parent().prevAll('li:visible').first().find('a');
				if (!imageswap.length)
					imageswap = $('#thumbs_list').find('a:visible').last();
				imgrepl = imageswap.find('img');
				//$(imageswap).addClass('shown');

			}	
			displayImage($(imageswap));
			
			/*$.fancybox(
	   			direction,
 			{
   			'hideOnContentClick': true,
   			'transitionIn' : 'elastic',
   			'transitionOut' : 'elastic',
   			'type' : 'image'
  			}
   			);*/

		});

 

How can I disable fancybox only for this function?

Is here a code to add below 'type' : 'image' to disable fancybox?

 

best regards

Link to comment
Share on other sites

It now is working adding "return false;"

The issue come when I add "display: none" to <div id="views_block" class="clearfix " style="display:none" because then my previous and next link image not working and I want these code for delete thum_list mini images

 

Any tip?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...