JQuery image effect plug-in Revealing for stretching and Amplification
This article will share with you the jQuery image display effect. The jQuery Revealing plug-in is used. images are arranged in a row without clicking. When any image thumbnail is clicked, this image is zoomed in. When you click the close button, the image is restored to the thumbnail mode.
Click the image, and the image is stretched and enlarged. The effect is great!
Usage:
1. the header area references the file jquery.js, photorevealer.js, and datouwang.css.
2. Add the region code to the file.
3. You can increase or decrease the number of images. You can add or delete images.
4. If more image information is required, you can modify the number of row 36th in photorevealer. js.
Core code:
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
$ (Document). ready (function (){ $ ('. Photo_slider'). each (function (){ Var $ this = $ (this). addClass ('photo-area '); Var $ img = $ this. find ('img '); Var $ info = $ this. find ('. info_area '); Var opts = {}; $ Img. load (function (){ Opts. imgw = $ img. width (); Opts. imgh = $ img. height (); }); Opts. orgw = $ this. width (); Opts. orgh = $ this. height (); $Img.css ({ MarginLeft: "-150px ", MarginTop: "-150px" }); Var $ wrap = $ ('<div class = "photo_slider_img">'). append ($ img). prependTo ($ this ); Var $ open = $ ('<a href = "#" class = "more_info"> More Info> </a>'). appendTo ($ this ); Var $ close = $ ('<a class = "close"> Close </a>'). appendTo ($ info ); Opts. wrapw = $ wrap. width (); Opts. wraph = $ wrap. height (); $ Open. click (function (){ $ This. animate ({ Width: opts. imgw, Height: (opts. imgh + 30 ), BorderWidth: "10" },600 ); $ Open. fadeOut (); $ Wrap. animate ({ Width: opts. imgw, Height: opts. imgh },600 ); $ (". Info_area", $ this). fadeIn (); $ Img. animate ({ MarginTop: "0px ", MarginLeft: "0px" },600 ); Return false; }); $ Close. click (function (){ $ This. animate ({ Width: opts. orgw, Height: opts. orgh, BorderWidth: "1" },600 ); $ Open. fadeIn (); $ Wrap. animate ({ Width: opts. wrapw, Height: opts. wraph },600 ); $ Img. animate ({ MarginTop: "-150px ", MarginLeft: "-150px" },600 ); $ (". Info_area", $ this). fadeOut (); Return false; }); }); }); |
The above is all the code in this article. I hope you will like it.