Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Making a rectangular transparent portion in a image using css and jquery Reply To: Making a rectangular transparent portion in a image using css and jquery

#146335
PSP
Participant

I tired using canvas but my app is for mobile and canvas animation works horribly bad.. So now I am trying same thing with
CSS.

I will frame my doubt in a more clear way:

This is my CSS

 #image{
   position:absolute;
  clip:rect(200px,300px,400px,100px);
 }

And this is my jquery.

  $( "#image" ).click(function() {
        $( "#image" ).animate({
                               height:"600"
                             }, 5000, function() {
                                               alert("done");  // Animation complete.
                                       });//animate
                             });//click

Yes, jquery increases the height but it increase whole image not only the clipped part. I want to enlarge only clipped part.
I hope I am more clear now.