<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Virgílio Cano on Medium]]></title>
        <description><![CDATA[Stories by Virgílio Cano on Medium]]></description>
        <link>https://medium.com/@virgiliocano?source=rss-720d5105ef5f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ERoJLxZCvfgLCRHY.jpg</url>
            <title>Stories by Virgílio Cano on Medium</title>
            <link>https://medium.com/@virgiliocano?source=rss-720d5105ef5f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 11:34:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@virgiliocano/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HTML, CSS, JavaScript: Scale Images onclick/addEventListener]]></title>
            <link>https://medium.com/@virgiliocano/html-css-javascript-scale-images-onclick-addeventlistener-a9c091b7cfee?source=rss-720d5105ef5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9c091b7cfee</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Virgílio Cano]]></dc:creator>
            <pubDate>Sun, 18 Apr 2021 01:36:42 GMT</pubDate>
            <atom:updated>2021-04-25T01:31:04.002Z</atom:updated>
            <content:encoded><![CDATA[<h4>A step by step to easily “transform: scale();” images with JavaScript.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*7ALf8ZSrA0qFtQr1vku9HQ.gif" /><figcaption>GIF image captured by the author</figcaption></figure><p>The combination of HTML, CSS, and JavaScript allows us to do cool stuff, like animations and effects on sites, and apps and let it more interactive and pleasant to navigate. Beneath, I’m sharing steps for scaling images. I hope this approach helps everyone who has struggled to master it.</p><h4>1. Write HTML code tags</h4><p>Yeah, it is obvious… Here you’ll take images from the &lt;img&gt; tag, better put within a &lt;div&gt; tag.</p><p>Note: Images source can be local (“./img/your-image.png”) or out there (“https://your-address/your-image.png”).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc2485d6a284c37f789791470b14150b/href">https://medium.com/media/cc2485d6a284c37f789791470b14150b/href</a></iframe><h4>2. Put CSS in action</h4><p>A little style to let images aligned and good to visualize.</p><p>Note: If you’re doing it on a local computer, don’t forget to call “<em>.css</em>” file within HTML file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c83634d542a14032f1511fa20a622ec/href">https://medium.com/media/1c83634d542a14032f1511fa20a622ec/href</a></iframe><h4>3. Make the click magic shows up with JavaScript</h4><p>As you note in &lt;img&gt; tag has an id attribute, we grab all the images in a JavaScript file through that. The variable that receives these images is converted to an array and using the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map"><em>map</em></a> method we capture each image, it permits us to get the event (click) in a specific image.</p><p>Note-1: Pay attention to setTimeout, is important to have it within the function that scales the image because you must remove the class added from the CSS file, this removal makes it possible you click in an image many times you need, and in end define a time to remove it. A tip: if your animation length is 5s, define removal with 4,5 (4500 milliseconds).</p><p>Note-2: If you’re doing it on a local computer, don’t forget to call “<em>.js</em>” file within HTML file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/efa754fc8827ddd29af6e6f10390fad2/href">https://medium.com/media/efa754fc8827ddd29af6e6f10390fad2/href</a></iframe><h4>Check it out on my <a href="https://codepen.io/virgiliocano">codepan</a></h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fvirgiliocano%2Fembed%2Fpreview%2FzYvGgPB%3Fheight%3D600%26slug-hash%3DzYvGgPB%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;display_name=CodePen&amp;url=https%3A%2F%2Fcodepen.io%2Fvirgiliocano%2Fpen%2FzYvGgPB%3Feditors%3D0010&amp;image=https%3A%2F%2Fassets.codepen.io%2F4356339%2Finternal%2Fscreenshots%2Fpens%2FzYvGgPB.default.png%3Ffit%3Dcover%26format%3Dauto%26ha%3Dtrue%26height%3D540%26quality%3D75%26v%3D2%26version%3D1618682388%26width%3D960&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/6536929533abeb3ed4d8d8e27baae972/href">https://medium.com/media/6536929533abeb3ed4d8d8e27baae972/href</a></iframe><p>Thanks for reading. I hope it helps you. Cheers!</p><blockquote>Determine never to be idle. No person will have occasion to complain of the want of time who never loses any. It is wonderful how much may be done if we are always doing. — Thomas Jefferson</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9c091b7cfee" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>