{"id":5298,"date":"2024-04-14T22:16:19","date_gmt":"2024-04-14T14:16:19","guid":{"rendered":"https:\/\/webflow.tenten.co\/?p=5298"},"modified":"2024-04-14T22:16:19","modified_gmt":"2024-04-14T14:16:19","slug":"enlarge-image-on-hover","status":"publish","type":"post","link":"https:\/\/webflow.tenten.co\/en\/enlarge-image-on-hover\/","title":{"rendered":"Enlarge Image on Hover"},"content":{"rendered":"\n<div class=\"docs_rich-text w-richtext\">\n<p>You may have images in your website that are rich in intricate details \u2014 such as product photos or artwork. By using some custom code, you can enable your visitors to hover over and amplify specific parts of these images \u2014 all without having to move a muscle.\u00a0<\/p>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9114c07753bf8d9e2f_6050061d8d70cf39c39aeb65_ulfds7s9ymokreovt7zc9guw4ih4ul_ftphmzu2fluvsyrn45s7z_5ig8qr85ax4jn_ietmaofeawhecukx2kzbwtr2hxnpf0ielxlytmfntzuq5vx8dhfi65vg1z3zbobaper7d.png\" alt=\"An image of pink, red and green boxes and watches is magnified on hover using custom code placed into a page\u2019s custom code settings in the Webflow Designer.\" title=\"64b94a9114c07753bf8d9e2f_6050061d8d70cf39c39aeb65_ulfds7s9ymokreovt7zc9guw4ih4ul_ftphmzu2fluvsyrn45s7z_5ig8qr85ax4jn_ietmaofeawhecukx2kzbwtr2hxnpf0ielxlytmfntzuq5vx8dhfi65vg1z3zbobaper7d\"><\/div>\n<\/figure>\n<p>This tutorial will guide you through the process of enlarging your images by inserting custom code into a page or a project by following these steps:\u00a0<\/p>\n<ol role=\"list\">\n<li>Insert the custom code<\/li>\n<li>Assign a class name<\/li>\n<li>Customize the magnifier<\/li>\n<\/ol>\n<div class=\"w-embed\">\n<div class=\"code-block\">\n<pre class=\"code-block_body\"><code id=\"snippet1\" class=\"code-block_code\">\n&lt;script type=\"text\/javascript\" src=\"https:\/\/assets.website-files.com\/5e2755779d8b8ea1d6373797\/5ea88e92dce9b4b66f165490_zoom.txt\"&gt;&lt;\/script&gt;\n&lt;script&gt;\n  jQuery(function(){\n\n  if(!$.fn.imagezoomsl){\n\n      $('.msg').show();\n      return;\n    }\n    else $('.msg').hide();\n\n    \/\/ plugin initialization\n    $('.image').imagezoomsl({\n\n      innerzoommagnifier: true,\n      classmagnifier: \"round-loope\",\n      magnifiersize: [150, 150],\n      \/\/ disables the scrolling of the document with the mouse wheel when the cursor is over the image\n      disablewheel: false\n    });\n  });\n&lt;\/script&gt;\n    <\/code><\/pre>\n<\/div>\n<\/div>\n<h2>Insert the custom code<\/h2>\n<p>There are two methods to insert the custom code into your project:\u00a0<\/p>\n<ul role=\"list\">\n<li>Include the code in the entire project<\/li>\n<li>Integrate the code in an individual page<\/li>\n<\/ul>\n<p>To insert the code into your entire project:<\/p>\n<ol role=\"list\">\n<li>Access your project\u2019s <strong>Settings<\/strong><\/li>\n<li>Select the <strong>Custom code<\/strong> tab<\/li>\n<li>Insert the code into the <strong>Footer code<\/strong> section (e.g., \u201cBefore &lt;\/body&gt; tag\u201d)<\/li>\n<li>Click <strong>Save changes<\/strong><\/li>\n<\/ol>\n<blockquote><p><strong>Note: <\/strong>You can insert the code into your project using hotkeys <strong>Command + V<\/strong> (on Mac) or <strong>Control + V<\/strong> (on Windows).<\/p><\/blockquote>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9014c07753bf8d9e08_6050061d120fca34400220a8_kpjo5klwwjgplkn8stffa7ihzhxsiqqrjobacdgcsiwbj0xixh44uablzisocebzxkacqwmtm31x2wy-cdktloactqc_v1zk8rqhbuyknbyibk4ff6dyvkabz0onw51rcxm6llzk.png\" alt=\"The Custom code tab is selected in a project\u2019s settings to show where custom code across a project can be placed.\u00a0\" title=\"64b94a9014c07753bf8d9e08_6050061d120fca34400220a8_kpjo5klwwjgplkn8stffa7ihzhxsiqqrjobacdgcsiwbj0xixh44uablzisocebzxkacqwmtm31x2wy-cdktloactqc_v1zk8rqhbuyknbyibk4ff6dyvkabz0onw51rcxm6llzk\"><\/div>\n<\/figure>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9114c07753bf8d9e17_6050061dd2a1b587ecc74690_mpcoui3zo9zj3cjg2lrvq-ajztyz9wxngyry-bbgysh585do7mnf1kbut9hen4c-iwq5igdtftk8b6j4tmyblezb3zgz7ubnt3yufrx-fjqneusu3cm-mitvykctguzomx3e3xh.png\" alt=\"The image magnification custom code should be placed in the Footer code section of the project\u2019s settings, and Before the &lt;\/body&gt; tag.\" title=\"64b94a9114c07753bf8d9e17_6050061dd2a1b587ecc74690_mpcoui3zo9zj3cjg2lrvq-ajztyz9wxngyry-bbgysh585do7mnf1kbut9hen4c-iwq5igdtftk8b6j4tmyblezb3zgz7ubnt3yufrx-fjqneusu3cm-mitvykctguzomx3e3xh\"><\/div>\n<\/figure>\n<p>To insert the code into an individual page:\u00a0<\/p>\n<ol role=\"list\">\n<li>Launch the <strong>Designer<\/strong><\/li>\n<li>Access the <strong>Pages panel<\/strong> and select the page settings cog icon of the desired page<\/li>\n<li>Scroll to the <strong>Custom code<\/strong> section within the page settings<\/li>\n<li>Insert the code into the <strong>Before &lt;\/body&gt; tag<\/strong> section<\/li>\n<li>Click <strong>Save<\/strong><\/li>\n<\/ol>\n<blockquote><p><strong>Note: <\/strong>You can paste the code into your project using hotkeys <strong>Command + V<\/strong> (on Mac) or <strong>Control + V<\/strong> (on Windows).<\/p><\/blockquote>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow.tenten.co\/wp-content\/uploads\/2024\/04\/64b94a9114c07753bf8d9ead_605222baa8db740a4d5eb345_3d.jpeg\" loading=\"lazy\" alt=\"To access a page\u2019s settings, open the Pages panel and hover over the page to see a cog icon to click.\u00a0\" title=\"64b94a9114c07753bf8d9ead_605222baa8db740a4d5eb345_3d\"><\/div>\n<\/figure>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9114c07753bf8d9e37_6050061d2fa23067cc14a16a_oolcie_yvhrcy5dqtjnz8bhj5-elynnkegqyt2rrljuyv9ymysndkvyu4eoiwnppwkt-lnw7qdlc9yrwqwm_242kan19avrzcbher0ohxfncqwdo9svj9e8nkz2e6uzyseqxgt8t.png\" alt=\"A page\u2019s custom code settings are highlighted, specifically the Before &lt;\/body&gt; tag section.\" title=\"64b94a9114c07753bf8d9e37_6050061d2fa23067cc14a16a_oolcie_yvhrcy5dqtjnz8bhj5-elynnkegqyt2rrljuyv9ymysndkvyu4eoiwnppwkt-lnw7qdlc9yrwqwm_242kan19avrzcbher0ohxfncqwdo9svj9e8nkz2e6uzyseqxgt8t\"><\/div>\n<\/figure>\n<p>You have successfully integrated the custom code into your project!<\/p>\n<h2>Assign a class name<\/h2>\n<p>Let\u2019s assign a unique class name to the images that we want to apply the magnification effect to:<\/p>\n<ol role=\"list\">\n<li>Select the <strong>Image<\/strong> you wish to magnify<\/li>\n<li>Access the <strong>Style panel<\/strong> and click on the <strong>Selector field<\/strong><\/li>\n<li>Give it a <strong>class<\/strong> (e.g., \u201cMagnify\u201d)\u00a0<\/li>\n<\/ol>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9114c07753bf8da04c_6050061d6cd671915b57bb11__uyq_pvye6av-n3yx4dpux7larcq8yy29j3ixd8iaj96qrjujoz4b7pyuxsonxa_e2_bxpydsuquco65wolzviufkipv1wfsopjrstdbzw3wd4lbpahkyiszvn1oh6ey1dst09er.png\" alt=\"The selector field of an image shows a new class of \u201cMagnify\u201d added to it.\" title=\"64b94a9114c07753bf8da04c_6050061d6cd671915b57bb11__uyq_pvye6av-n3yx4dpux7larcq8yy29j3ixd8iaj96qrjujoz4b7pyuxsonxa_e2_bxpydsuquco65wolzviufkipv1wfsopjrstdbzw3wd4lbpahkyiszvn1oh6ey1dst09er\"><\/div>\n<\/figure>\n<p>Let\u2019s include the \u201cMagnify\u201d class in our code:\u00a0<\/p>\n<ol role=\"list\">\n<li>Access the <strong>Pages panel<\/strong> and select the page settings cog icon of the page where your custom magnifier code is placed<\/li>\n<li>Scroll to the <strong>Before &lt;\/body&gt; tag<\/strong> section in your page\u2019s settings<\/li>\n<li>Replace \u201c.<strong>image<\/strong>\u201d with your class name (e.g., \u201c.<strong>magnify<\/strong>\u201d)\u00a0<\/li>\n<li>Click <strong>Save<\/strong><\/li>\n<\/ol>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div>\n        <img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9114c07753bf8d9e44_6050061da558dc5ddfdbd312_hxqfjgqfrrdnxcx9l4l-h38geeuisb6a5-fk8q8m4jvfuh_ekmojvrakxqceobehiokzev9y2orp-oayyfgiguk0lem63dklv7sanwjhvg3n4jmfywg1t4dbgpzecog2jkyrx82_.png\" alt=\"After inserting the code for image enlargement into the custom code of the page settings, ensure to modify the code to correspond to the newly defined \u201cMagnify\u201d class.\" title=\"64b94a9114c07753bf8d9e44_6050061da558dc5ddfdbd312_hxqfjgqfrrdnxcx9l4l-h38geeuisb6a5-fk8q8m4jvfuh_ekmojvrakxqceobehiokzev9y2orp-oayyfgiguk0lem63dklv7sanwjhvg3n4jmfywg1t4dbgpzecog2jkyrx82_\">\n    <\/div>\n<\/figure>\n<blockquote><p>\n    <strong>Helpful tip: <\/strong>Instead of replicating or copying classes in an ongoing project, consider using a <strong>Global class<\/strong> or a <strong>Combo class<\/strong> to establish a unique class for images intended for magnification. Ensure that the distinct magnification class name has been included in your custom code according to the previously outlined steps. Discover more about Global classes and Combo classes.\n<\/p><\/blockquote>\n<p>Go ahead and publish your project and navigate to your live site to witness your personalized code in operation. Simply hover over the image where you&#8217;ve applied the class name (such as images identified with the class name \u201cMagnify\u201d), and observe a magnifying glass tracking your cursor movements as you glide it across the image.<\/p>\n<h2>Customize the magnifying tool<\/h2>\n<p>By default, the magnifying glass is a square measuring 150 by 150 pixels. Let\u2019s modify its dimensions, shape, and introduce a drop shadow effect.<\/p>\n<p>The default setting in our custom code specifies the magnifier size as 150 by 150 pixels. Let\u2019s enlarge it:<\/p>\n<ol role=\"list\">\n<li>Access the <strong>Pages panel<\/strong> and select the page settings cog icon on the page containing your tailored magnifying code.<\/li>\n<li>Scroll down to the <strong>Before &lt;\/body&gt; tag<\/strong> section within your page settings and pinpoint the &#8220;magnifiersize: [150, 150]&#8221; snippet of code.<\/li>\n<li>Adjust both 150 pixel values to a larger figure (e.g., 300 pixels for each).<\/li>\n<li>Save your changes.<\/li>\n<\/ol>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div>\n        <img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9014c07753bf8d9e10_6050061d07c237565dc40b8e_c7_l-kunbz5vngspbhq0yty5kdlprjr1zwy0rluvhmcxlrriufbibghscm5yvskhsuwuniwzci5xvau6aefw-vxvoaqv2xpxolve2w_3pb8jqwlvaf622_738znfgrpwzwcmrdic.png\" alt=\"To adjust the size of the magnifier, you must modify the pixel values in the magnifier size section of the custom code within the page\u2019s settings.\" title=\"64b94a9014c07753bf8d9e10_6050061d07c237565dc40b8e_c7_l-kunbz5vngspbhq0yty5kdlprjr1zwy0rluvhmcxlrriufbibghscm5yvskhsuwuniwzci5xvau6aefw-vxvoaqv2xpxolve2w_3pb8jqwlvaf622_738znfgrpwzwcmrdic\">\n    <\/div>\n<\/figure>\n<p>Let\u2019s transform the magnifier shape from a square to a circle by setting a foundational style on a fresh <strong>Div block<\/strong>:<\/p>\n<ol role=\"list\">\n<li>Open the <strong>Navigator<\/strong> and choose the <strong>Body<\/strong> element.<\/li>\n<li>Utilize <strong>Quick find<\/strong> to insert a <strong>Div block<\/strong> as the concluding element on the page.<\/li>\n<li>Select the <strong>Div block<\/strong>, launch the <strong>Style panel<\/strong>, and click into the <strong>Selector field<\/strong>.<\/li>\n<li>Assign a class name to the <strong>Div block<\/strong> to enable the custom code to recognize the new magnifier shape (e.g., \u201cround-loope\u201d).<\/li>\n<li>Access <strong>Style panel<\/strong> &gt; <strong>Borders<\/strong> and define a <strong>Radius<\/strong> of 50%.<\/li>\n<\/ol>\n<p>At this stage, the Div block might appear oval, but the magnifier&#8217;s size is controlled by the 300 pixels you previously set.<\/p>\n<blockquote><p>\n    <strong>Insider tip: <\/strong>Press <strong>Command<\/strong> + <strong>E<\/strong> (on Mac) or <strong>Control<\/strong> + <strong>E<\/strong> (on Windows) to trigger <strong>Quick find<\/strong> and promptly append elements to your project.\n<\/p><\/blockquote>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div>\n        <img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9114c07753bf8da04f_6050061e1ea2614e493f7026_u8uhsuxvxt3-rz3spgx2ulkztk_rwwgghvlmi1nctsjelao2h0gkti5xosgixwrisuiixdddgr7ie4ati71qlcotiuz30gsc49q9xi37jquyxyx2_wzuwoytsjzk3vrgtrsoniol.png\" alt=\"The Selector field of the styled Div block displays a novel class of \u201cround-loope\u201d appended to it.\" title=\"64b94a9114c07753bf8da04f_6050061e1ea2614e493f7026_u8uhsuxvxt3-rz3spgx2ulkztk_rwwgghvlmi1nctsjelao2h0gkti5xosgixwrisuiixdddgr7ie4ati71qlcotiuz30gsc49q9xi37jquyxyx2_wzuwoytsjzk3vrgtrsoniol\">\n    <\/div>\n<\/figure>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div>\n        <img decoding=\"async\" src=\"https:\/\/webflow.tenten.co\/wp-content\/uploads\/2024\/04\/64b94a9114c07753bf8da049_6050061e39728595ff52deab_otvvixv3tmzuohccugfrrzdexi18dv5qoqptfyrzegf-jbvxe5nly4mx7o6v0rtmb-qsi4fdu9tsbndiui3_lwajavrl5uadminm7xqyneqigihujdkiklmgmyrcbblqaatfjd2p.png\" alt=\"The Border radius of the \u201cround-loope\u201d Div block is adjusted to 50%.\" title=\"64b94a9114c07753bf8da049_6050061e39728595ff52deab_otvvixv3tmzuohccugfrrzdexi18dv5qoqptfyrzegf-jbvxe5nly4mx7o6v0rtmb-qsi4fdu9tsbndiui3_lwajavrl5uadminm7xqyneqigihujdkiklmgmyrcbblqaatfjd2p.png\">\n    <\/div>\n<\/figure>\n<p>To introduce more depth to the magnifier, let\u2019s include a shadow behind it:<\/p>\n<ol role=\"list\">\n<li>Choose the <strong>Div block<\/strong>.<\/li>\n<li>Access the <strong>Style panel<\/strong> &gt; <strong>Effects<\/strong>.<\/li>\n<li>Incorporate a <strong>Box shadow<\/strong> by selecting the plus icon and customize the shadow according to your preference.<\/li>\n<\/ol>\n<p>Since our \u201cround-loope\u201d <strong>Div block<\/strong> solely affects the styling of our magnifier, we do not want the <strong>Div block<\/strong> to be visible on our page. Let\u2019s conceal it from view:<\/p>\n<ol role=\"list\">\n<li>Select the \u201cround-loope\u201d <strong>Div block<\/strong>.<\/li>\n<li>Open the <strong>Style panel<\/strong> &gt; <strong>Layout<\/strong>.<\/li>\n<li>Adjust the <strong>Display<\/strong> to <strong>none<\/strong>.<\/li>\n<li><strong>Publish<\/strong> the project and explore your site to preview the newly styled magnifier.<\/li>\n<\/ol>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div>\n        <img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9114c07753bf8d9e2f_6050061d8d70cf39c39aeb65_ulfds7s9ymokreovt7zc9guw4ih4ul_ftphmzu2fluvsyrn45s7z_5ig8qr85ax4jn_ietmaofeawhecukx2kzbwtr2hxnpf0ielxlytmfntzuq5vx8dhfi65vg1z3zbobaper7d.png\" alt=\"An image showcasing pink, red, and green boxes and watches magnified upon hovering using custom code integrated into the page\u2019s custom code settings within the Webflow Designer.\" title=\"64b94a9114c07753bf8d9e2f_6050061d8d70cf39c39aeb65_ulfds7s9ymokreovt7zc9guw4ih4ul_ftphmzu2fluvsyrn45s7z_5ig8qr85ax4jn_ietmaofeawhecukx2kzbwtr2hxnpf0ielxlytmfntzuq5vx8dhfi65vg1z3zbobaper7d\">\n    <\/div>\n<\/figure>\n<p>The magnifying tool also functions on mobile gadgets. Users can tap on the image to view close-ups, especially on devices like tablets and smartphones.<\/p>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div>\n        <img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94a9114c07753bf8da046_6050061ef205887b88d0e8dc_oguzs8msoyatozvg7nd7bhztekt7so_dgrh5uchdpwpfwybtzr_zhopnhwyyfuuucqjrpsdt1obrqjyd09vob-z5vqlrpbzzyzujegjssh_a2mczakdcxzmpi0c_hg43yh9dqtgb.png\" alt=\"An image presenting pink, red, and green boxes and watches magnified on mobile devices by tapping on segmented areas of the image. This capability is achieved through custom code integrated into the page\u2019s custom code settings in the Webflow Designer.\" title=\"64b94a9114c07753bf8da046_6050061ef205887b88d0e8dc_oguzs8msoyatozvg7nd7bhztekt7so_dgrh5uchdpwpfwybtzr_zhopnhwyyfuuucqjrpsdt1obrqjyd09vob-z5vqlrpbzzyzujegjssh_a2mczakdcxzmpi0c_hg43yh9dqtgb\">\n    <\/div>\n<\/figure>\n<p>Congratulations! You\u2019ve enhanced the potential of your images with magnification capabilities!<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"Add a desktop and mobile-friendly magnifier for images on mouse hover using custom code.","protected":false},"author":2,"featured_media":5299,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":"","footnotes":""},"categories":[284],"tags":[],"class_list":{"0":"post-5298","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-layout-design","8":"cs-entry"},"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts\/5298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/comments?post=5298"}],"version-history":[{"count":0,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts\/5298\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/media\/5299"}],"wp:attachment":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/media?parent=5298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/categories?post=5298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/tags?post=5298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}