Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guys,

Consider i have two images on my webpage(one over other, positioned using Z-index).
Now, I want to select part(in rectangular shape) of a top image, and that selected part should become transparent so that in that transparent area, I can see part of a below image.

I tried using many jquery cropping plugins but no use.
Is this impossible or Is there any way to do this using CSS,javascript and Jquery?

Thanks for your help.
Praveen.
Posted
Updated 26-May-13 9:00am
v2
Comments
Please rename your profile name to remove the mail address, otherwise you may receive spams.

And please post the code or the online demo in jsfiddle, so that it will be easy to modify your code.
Zoltán Zörgő 26-May-13 16:02pm    
If you don't want to get server side involved, I suppose only HTML5 (Canvas) is the only option.

1 solution

How about placing the "bottom" image on top instead of making it really underneath and when you select a rectangle setting its size to the size of the selected rectangle. Position of its background must match the rectangles offset and padding top and left to make it look as it was in the correct place.

This way you dont have to change the image itself just change few css properties.
 
Share this answer
 
v2
Comments
praveena0989@gmail.com 28-May-13 2:23am    
Thank u so much.. worked...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900