Canvas css filter lost when I use Jcrop

Canvas css filter lost when I use Jcrop

hi guys
I am using JCROP to crop images and applying a css filter to it. However when the canvas (image) is cropped, it loses its css, (ie the User chosen filter is lost)

However if I call the same function via button click it works, but not with jcrop

Here is my code

Ehi

  1.    function CanvasCropCSS() {      // THIS IS CSS FILTER FUNCTION
  2.           $("#canvas").removeClass();
  3.           var t = $("#Hidden_Filter").val();    //It gets the value of the applied filter from a hidden field
  4.           alert(t);
  5.         // $("#canvas").AddClass($(('#Hidden_Filter').val());   // This only works when applied to a button event
  6.         };

  7.         function applyCrop() {
  8.             canvas.width = prefsize.w;
  9.             canvas.height = prefsize.h;
  10.             context.drawImage(image, prefsize.x, prefsize.y, prefsize.w, prefsize.h, 0, 0,          canvas.width, canvas.height);
  11.             validateImage();
  12.              CanvasCropCSS()      // THIS IS CSS FILTER FUNCTION -
  13.            
  14.         }
  15. // The CanvasCropCSS funtion does not work if I add it to the JCROP, but works if I apply to a button event or anything else