merge master
This commit is contained in:
		
				commit
				
					
						3ed2399337
					
				
			
		
					 68 changed files with 3099 additions and 950 deletions
				
			
		|  | @ -39,7 +39,7 @@ | |||
|         _initScroll(); | ||||
|         _initNavUrl(); | ||||
|         _initPricing(); | ||||
| 
 | ||||
|         ajaxForms(); | ||||
|     }); | ||||
| 
 | ||||
|     $(window).resize(function() { | ||||
|  | @ -157,4 +157,27 @@ | |||
|         $('#valueTotal').text(numbers * price * 31); | ||||
|     } | ||||
| 
 | ||||
| })(jQuery); | ||||
|     function ajaxForms() { | ||||
|         $('body').on('submit', '.ajax-form', function(e){ | ||||
|             e.preventDefault(); | ||||
|             var $form = $(this); | ||||
|             $form.find('[type=submit]').addClass('sending'); | ||||
|             $.ajax({ | ||||
|                 url: $form.attr('action'), | ||||
|                 type: $form.attr('method'), | ||||
|                 data: $form.serialize(), | ||||
| 
 | ||||
|                 success: function(response) { | ||||
|                     var responseContain = $($form.attr('data-response')); | ||||
|                     responseContain.html(response); | ||||
|                     $form.find('[type=submit]').removeClass('sending'); | ||||
|                 }, | ||||
| 
 | ||||
|                 error: function() { | ||||
|                     $form.find('[type=submit]').removeClass('sending'); | ||||
|                     $form.find('.form-error').removeClass('hide'); | ||||
|                 } | ||||
|             }); | ||||
|         }) | ||||
|     } | ||||
| })(jQuery); | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue