×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: Sep 11, 2017 9:56 PM
Views: 6
Tags: toggle
  1.  var startSize = $('.product-spoiler').css('border-bottom-left-radius') || 0,
  2.         endSize = 30,
  3.         size,
  4.         duration,
  5.         visible;
  6.  
  7.     $('.product-spoiler').on('click', function () {
  8.         $(this).find('.show-block').slideToggle(duration);
  9.  
  10.         visible = $(this).find('.show-block').is(':visible');
  11.  
  12.         size = visible ?startSize :endSize;
  13.  
  14.         $(this).animate({
  15.             borderBottomLeftRadius: size,
  16.             borderBottomRightRadius: size
  17.         }, duration);
  18.     });