Submiting form after animation
Hello
I have a small problem with a form.
After i click on a submit button a small animation starts, i would like to submit form after animation but nothing is working. I tried different methods and i also checked html for errors.
Code of function:
- $(document).ready(function(){
- $("#button").click(function() {
- var productX = $("#first").offset().left;
- var productY = $("#first").offset().top;
- var basketX = $("#basket").offset().left+15;
- var basketY = $("#basket").offset().top+20;
- var gotoX = basketX - productX;
- var gotoY = basketY - productY;
- var newImageWidth = $("#first img").width() / 3;
- var newImageHeight = $("#first img").height() / 3;
- $("#first img")
- .clone()
- .prependTo("#first")
- .css({'position' : 'absolute'})
- .animate({opacity: 0.9}, 100 )
- .animate({opacity: 0.6, marginLeft: gotoX, marginTop: gotoY, width: newImageWidth, height: newImageHeight}, 1200, function(){
- $("#detailstext").submit(); //form id
- });
- return false;
- });
- });
I also tried
- $("form_id").post(0).submit();
but i got error:
- $("form_id").post is not a function