IMAGE ZOOM TOUR WITH JQUERY

    Rating: ★★★★☆
    View: 228
    Download: 209
    Từ khóa:

    This next step can contain other tags that again allow to show more images. We achieve the "zoom" effect by enlarging the current image and fading in the new one.

    Today we want to share a little zoom tour script with you. Showing a main image initially, we want to be able to zoom into certain parts of the image by clicking on tags, using another image for the closer view. This next step can contain other tags that again allow to show more images. We achieve the “zoom” effect by enlarging the current image and fading in the new one.

    The images used in the demos can be found here:
    image1: City Crowd
    image1_5: Office
    image2: Ikea Room
    image3_n: Portimão Marina
    Background Pattern by http://www.blunia.com/ on http://subtlepatterns.com/

    THE HTML STRUCTURE

    For the HTML structure we will have a main container and each image inside of a div with the class “zt-item”:

     is the image in each step. The item then have tags with certain attributes.
    The data attributes are the following:

    1. data-dir is either 1 or -1 depending on whether we want to “zoom in” (1) or “zoom back out” (-1)
    2. data-link will indicate to which item we connect the tag to (based on the data-id we give to each item)
    3. data-zoom is the factor of zooming. Set very low, the image we zoom into or zoom back to will only enlarge slightly.
    4. data-speed the animation speed in milliseconds
    5. data-delay the delay time for the new image to appear

    The example structure above has the first initial image (zt-item-1) with two tags that lead to zt-item-2 and zt-item-3. zt-item-2 and zt-item-3 only have the back tag. As you can see, the back tag has another class “zt-tag-back” and a data-dir value of -1.

    The position of the tags is defined in the style attribute and you can also add another size for it, too.

    OPTIONS

    The following are the default options:

    $('#zt-container').zoomtour({
        // if true the tags are rotated depending on their position
        rotation        : true,
        // zoom out animation easing. Example: easeOutBounce , easeOutBack  
        zoominEasing    : '',  
        // zoom out animation easing
        zoomoutEasing   : ''   
    });

    We hope you like this little script and find it useful!

    loading Đang tải...

    template được ưa chuộng