Merge pull request #3078 from tinect/fixIE11
IE11 doesn't support optional parameters
This commit is contained in:
		@@ -13,7 +13,16 @@ $(document).ready(function() {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // https://stackoverflow.com/questions/4399005/implementing-jquerys-shake-effect-with-animate
 | 
					  // https://stackoverflow.com/questions/4399005/implementing-jquerys-shake-effect-with-animate
 | 
				
			||||||
  function shake(div,interval=100,distance=10,times=4) {
 | 
					  function shake(div,interval,distance,times) {
 | 
				
			||||||
 | 
					      if(typeof interval === 'undefined') {
 | 
				
			||||||
 | 
					        interval = 100;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      if(typeof distance === 'undefined') {
 | 
				
			||||||
 | 
					        distance = 10;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      if(typeof times === 'undefined') {
 | 
				
			||||||
 | 
					        times = 4;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    $(div).css('position','relative');
 | 
					    $(div).css('position','relative');
 | 
				
			||||||
    for(var iter=0;iter<(times+1);iter++){
 | 
					    for(var iter=0;iter<(times+1);iter++){
 | 
				
			||||||
      $(div).animate({ left: ((iter%2==0 ? distance : distance*-1))}, interval);
 | 
					      $(div).animate({ left: ((iter%2==0 ? distance : distance*-1))}, interval);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user