<?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 Usmaan Ali on Medium]]></title>
        <description><![CDATA[Stories by Usmaan Ali on Medium]]></description>
        <link>https://medium.com/@usyyy?source=rss-95a11fd0a3fc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DPfugRTBprNd8s_mk8q_CA.jpeg</url>
            <title>Stories by Usmaan Ali on Medium</title>
            <link>https://medium.com/@usyyy?source=rss-95a11fd0a3fc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 06 May 2026 23:39:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@usyyy/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[Javascript 30 (Day 30)]]></title>
            <link>https://blog.cloudboost.io/javascript-30-day-30-3fedbd924ad4?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fedbd924ad4</guid>
            <category><![CDATA[web-developer]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript30]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Fri, 08 Sep 2017 08:03:51 GMT</pubDate>
            <atom:updated>2020-07-16T15:11:08.831Z</atom:updated>
            <content:encoded><![CDATA[<h4>Whack A Mole</h4><p>Demo can be found <a href="https://yhabib.github.io/JavaScript30/30%20-%20Whack%20A%20Mole/index.html">here</a>.</p><p>What I learned on this mini-project.</p><h3>isTrusted</h3><p>Here, the click event is important in determining the outcome of the game, therefore we need to protect from false clicks that can be be mimicked through cheeky javascript code.</p><p>Using the isTrusted property allows you to confirm that the event was generated by a user action.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9e76e9e5b45f9e9ee573944cc0c8818/href">https://medium.com/media/b9e76e9e5b45f9e9ee573944cc0c8818/href</a></iframe><p>The code above, will return if the event was not a product of user action (not through a script).</p><h3>Recursion</h3><p>This technique was used to prevent the same hole from being used twice in a row. It’s important to return the value in the randomHole method, so that it can be used recursively.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/768cbf1c26ad09d6895f178967213197/href">https://medium.com/media/768cbf1c26ad09d6895f178967213197/href</a></iframe><p>Here, the lastHole variable will be assigned to the randomly generated hole. If the following call generates the same hole, the randomHole will be called again until lastHole != hole.</p><p><em>Originally published at </em><a href="http://gist.github.com/d53418f23b443f3a757c731cbdab7899"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fedbd924ad4" width="1" height="1" alt=""><hr><p><a href="https://blog.cloudboost.io/javascript-30-day-30-3fedbd924ad4">Javascript 30 (Day 30)</a> was originally published in <a href="https://blog.cloudboost.io">CloudBoost</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 (Day 29)]]></title>
            <link>https://medium.com/@usyyy/javascript-30-day-29-facf511f6255?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/facf511f6255</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-developer]]></category>
            <category><![CDATA[javascript30]]></category>
            <category><![CDATA[junior-developer]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Thu, 07 Sep 2017 07:48:54 GMT</pubDate>
            <atom:updated>2017-09-07T07:48:54.907Z</atom:updated>
            <content:encoded><![CDATA[<h4>Countdown Timer</h4><p>Demo can be found <a href="https://yhabib.github.io/JavaScript30/29%20-%20Countdown%20Timer/index.html">here</a>.</p><p>What I learned on this mini-project.</p><h3>setInterval() and clearInterval()</h3><p>The setInterval method has been used in previous projects, but in this case it&#39;s used a little differently, in conjunction with clearInterval.</p><p>When you wish for a function or code piece of code to run every so often, setInterval can be used.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/42d8023dab0a6a4c9e8bbe80e4bb7600/href">https://medium.com/media/42d8023dab0a6a4c9e8bbe80e4bb7600/href</a></iframe><p>Here, an anonymous function which defines a constant is ran every 1000 milliseconds.</p><p>In order to clear the countdown variable i.e stop the method running via setInterval you need to clear it. If you don&#39;t do this, and try to run the method whilst it&#39;s already running (through another function call), they will both run, which can cause erratic behavior.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2b6af1a14f53023a118b904814beca2/href">https://medium.com/media/c2b6af1a14f53023a118b904814beca2/href</a></iframe><p>Here, the method being executed under a given time interval is assigned to countdown, so clearing the variable does the job of cancelling the method calls.</p><h3>Working with timestamps</h3><p>If you want the current time, then Date.now() can be used, this will return the number of milliseconds elapsed since 01/01/1970.</p><p>It’s easy to turn this into a date object via new Date(milliseconds), where the value extracted from Date.now() is used as a parameter.</p><p>Using this object, various methods can be called, to extract different aspects of the time data such as the day, month and year.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bfadf4660b994e1d9b741f1c49d467ab/href">https://medium.com/media/bfadf4660b994e1d9b741f1c49d467ab/href</a></iframe><h3>Form element selectors</h3><p>When you want to attach an event to a form, you can utilise this to extract it&#39;s input values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/90c80493b29eabfb62e2672de8bbabb0/href">https://medium.com/media/90c80493b29eabfb62e2672de8bbabb0/href</a></iframe><p>Here, an event listener is attached to the form via its name attribute customForm, and its inputs are extracted by accessing properties off this.</p><p><em>Originally published at </em><a href="http://gist.github.com/ced1689fcd8baceae9ee930796f34675"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=facf511f6255" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 (Day 28)]]></title>
            <link>https://medium.com/@usyyy/javascript-30-day-28-607ce95659fb?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/607ce95659fb</guid>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[javascript30]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-developer]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Wed, 06 Sep 2017 08:04:04 GMT</pubDate>
            <atom:updated>2017-09-06T08:04:04.264Z</atom:updated>
            <content:encoded><![CDATA[<h4>Video Speed Controller</h4><p>Demo can be found <a href="https://yhabib.github.io/JavaScript30/28%20-%20Video%20Speed%20Controller/index.html">here</a>.</p><p>What I learned on this mini-project.</p><h3>offsetHeight</h3><p>This property represents the height of an element, including vertical padding and borders. It is measured in pixels and is returned as an integer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31b08d8134a8fcebd38c899a44af3713/href">https://medium.com/media/31b08d8134a8fcebd38c899a44af3713/href</a></iframe><p>In this case, offsetHeight was used in the percentage calculation used to fill the speed-bar.</p><h3>Normalize value</h3><p>It made sense for the speed-bar to have appropriate minimum and maximum values, to achieve this, normalization was used, allowing us to map the percentage scrolled, to these minimum and maximum values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cffe6ed3623d86d02081d00d86ec5422/href">https://medium.com/media/cffe6ed3623d86d02081d00d86ec5422/href</a></iframe><p>In this case, minimum = 0.4 and maximum = 4. So, the percentage scrolled would fall between the two. For example 10% is approximately equal to a playBackRate of 0.43.</p><p><em>Originally published at </em><a href="http://gist.github.com/4d496e43f3adc9344d41ad641d0203f7"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=607ce95659fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 (Day 27)]]></title>
            <link>https://medium.com/@usyyy/javascript-30-day-27-92bfbc830d5c?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/92bfbc830d5c</guid>
            <category><![CDATA[web-developer]]></category>
            <category><![CDATA[javascript30]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Tue, 05 Sep 2017 07:58:45 GMT</pubDate>
            <atom:updated>2017-09-05T07:58:45.193Z</atom:updated>
            <content:encoded><![CDATA[<h4>Click and Drag</h4><p>Demo can be found <a href="https://yhabib.github.io/JavaScript30/27%20-%20Click%20and%20Drag/index.html">here</a>.</p><p>What I learned on this mini-project.</p><h3>Flag variable</h3><p>These can be used to control the flow of a method or other piece of functionality.</p><p>They are mainly used to hold a value until some condition changes, after which you can modify the variable. One of the most common use cases for this is holding a boolean which is dependent on some other piece of code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ec5ab63d1358db8f5aa9215ec13fa30/href">https://medium.com/media/7ec5ab63d1358db8f5aa9215ec13fa30/href</a></iframe><p>In this example, the isDown variable is used to track the state of the mouse. When the mousedown event is triggered the isDown variable is changed, which is used to add further functionality.</p><h3>pageX and offsetLeft</h3><p>In this project, the mousedown event is used to initiate the click and drag functionality. For this to work effectively, an anchor point was used, representing the initial click point, the pageX property of the event captures this value.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/60e15220268c260ceafadaca5d3c2165/href">https://medium.com/media/60e15220268c260ceafadaca5d3c2165/href</a></iframe><p>If a margin or padding is added, then the pageX value will be off, to compensate for this adjustment, you can subtract the pixels changed (from the parent element&#39;s offset) to the window.</p><p>The code to do this, is shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/969a9657f9a59fc6399f788c5aba0739/href">https://medium.com/media/969a9657f9a59fc6399f788c5aba0739/href</a></iframe><p><em>Originally published at </em><a href="http://gist.github.com/07c450409f85fc657aa97ca1aa883fad"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92bfbc830d5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 (Day 26)]]></title>
            <link>https://medium.com/@usyyy/javascript-30-day-26-1034ec8da707?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/1034ec8da707</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript30]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Mon, 04 Sep 2017 07:43:25 GMT</pubDate>
            <atom:updated>2017-09-04T07:43:25.037Z</atom:updated>
            <content:encoded><![CDATA[<h4>Stripe Follow Along Nav</h4><p>Demo can be found <a href="https://yhabib.github.io/JavaScript30/26%20-%20Stripe%20Follow%20Along%20Nav/index.html">here</a>.</p><p>What I learned on this mini-project.</p><h3>CSS &gt; selector</h3><p>This is used when you wish to match <strong>direct</strong> descendent elements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d741340b0d9348a5319b72fca33600b/href">https://medium.com/media/9d741340b0d9348a5319b72fca33600b/href</a></iframe><p>So, in this case the first li tag, of elements with a class of cool will be selected.</p><h3>Using multiple classes for progressive effects</h3><p>In this project, an element needs to be displayed <strong>and</strong> faded in. To begin with, the element is given the following CSS… display: none, an unfortunate consequence of this, is that transitions can&#39;t be applied elements that aren&#39;t displayed.</p><p>By using multiple classes and adding CSS sequentially, you can first add the element to the page through a class with display: block, then add a second class with the desired transformation properties.</p><p>The following code demonstrates this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d424926cdbf4c93322c7cf3ad02b7c58/href">https://medium.com/media/d424926cdbf4c93322c7cf3ad02b7c58/href</a></iframe><p><strong>Note</strong>, a delay of 150ms has been added before adding the second class, this is to maintain the order in which the classes are added.</p><h3>getBoundingClientRect modification</h3><p>This object, will by default, give positional values based on the current viewport’s top-left point (which corresponds to (0, 0)).</p><p>On occasion however, you might want the element you are targeting to be based on another element.</p><p>To do this, you must get that element’s positional values via getBoundingClientRect and subtract these from the target element&#39;s positional values.</p><p>An example is shown below, where the dropdown is positioned based on the &#39;nav&#39;.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f15eeed6ea27b89ba0f7a8ab3abfe243/href">https://medium.com/media/f15eeed6ea27b89ba0f7a8ab3abfe243/href</a></iframe><p><em>Originally published at </em><a href="http://gist.github.com/82d31350502633bb9dfd909ce918e75d"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1034ec8da707" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 (Day 25)]]></title>
            <link>https://medium.com/@usyyy/javascript-30-day-25-395d4a2ced1b?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/395d4a2ced1b</guid>
            <category><![CDATA[document-object-model]]></category>
            <category><![CDATA[event-delegation]]></category>
            <category><![CDATA[javascript30]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Fri, 25 Aug 2017 11:50:26 GMT</pubDate>
            <atom:updated>2017-08-25T11:51:33.812Z</atom:updated>
            <content:encoded><![CDATA[<h4>Event Capture, Propagation, Bubbling and Once</h4><p>Demo can be found <a href="https://yhabib.github.io/JavaScript30/25%20-%20Event%20Capture,%20Propagation,%20Bubbling%20and%20Once/index.html">here</a> (open up dev tools).</p><p>What I learned on this mini-project.</p><h3>capture</h3><p>When an event listener has been attached to a DOM element whose parent has the same listener. triggering the event will lead to both elements firing.</p><p>By default the events will be triggered from the inside out, but setting capture to true in third options parameter, will reverse this direction.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/656bcd18200c5aa1273c6367a684e281/href">https://medium.com/media/656bcd18200c5aa1273c6367a684e281/href</a></iframe><h3>once</h3><p>This is a useful option for the addEventListener method, that will prevent the element from triggering multiple events. It has the same functionality as removeEventListener for those higher in the chain.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9288c1ea6998d0a1060fa52e227b782/href">https://medium.com/media/d9288c1ea6998d0a1060fa52e227b782/href</a></iframe><h3>Event Propagation</h3><p>This is the blanket term that refers to bubbling and capturing. It essentially means that events will cascade up and down the DOM, from the target element all the way up to the window object.</p><p>The direction of propagation can be both ways.</p><p>A nice summary of the concept is explained by dividing it into three phases.</p><p>This was taken from the following <a href="https://www.sitepoint.com/event-bubbling-javascript/">article</a>.</p><ul><li>capture phase - From the window to the event target</li><li>target phase - The event target</li><li>bubble phase - From the event target back to the window</li></ul><p><em>Originally published at </em><a href="http://gist.github.com/46d7ea274f9fac0ee1285bf2020a1e62"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=395d4a2ced1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 (Day 24)]]></title>
            <link>https://medium.com/@usyyy/javascript-30-day-24-ce4749118d73?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce4749118d73</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript30]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Thu, 24 Aug 2017 09:04:19 GMT</pubDate>
            <atom:updated>2017-08-24T09:04:19.997Z</atom:updated>
            <content:encoded><![CDATA[<h4>Sticky Nav</h4><p>Demo can be found <a href="https://yhabib.github.io/JavaScript30/24%20-%20Sticky%20Nav/index.html">here</a>.</p><p>What I learned on this mini-project.</p><h3>position: fixed</h3><p>The main purpose of this project was to learn about the effects of changing an elements position to fixed.</p><p>When applying this property, the element is essentially taken out of the DOM which vacates the space it previously held in it.</p><p>This causes a reshuffle for the other elements, which can cause a judder when an elements position is changed to fixed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/75069595c355dc3c6da4586f33a43247/href">https://medium.com/media/75069595c355dc3c6da4586f33a43247/href</a></iframe><p>One workaround to this, is to fill in the space vacated by adding padding. This can be done multiple ways, but it makes sense to make this value dynamic, so that it adapts when the layout of the page is changed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ec981cc008546e168302434e30ccdb2/href">https://medium.com/media/9ec981cc008546e168302434e30ccdb2/href</a></iframe><p><em>Originally published at </em><a href="http://gist.github.com/2504f69e86c0b71e0bbd4801c444b506"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce4749118d73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 (Day 23)]]></title>
            <link>https://medium.com/@usyyy/javascript-30-day-23-7b3d1b2af08b?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b3d1b2af08b</guid>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[javascript30]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Wed, 23 Aug 2017 07:42:09 GMT</pubDate>
            <atom:updated>2017-08-23T07:42:09.063Z</atom:updated>
            <content:encoded><![CDATA[<h4>Speech Synthesis</h4><p>Demo can be found <a href="https://yhabib.github.io/JavaScript30/23%20-%20Speech%20Synthesis/index.html">here</a>.</p><p>What I learned on this mini-project.</p><h3>speechSynthesisUtterance</h3><p>This is an interface for the Web Speech API. It contains the content that the speech service will read, as well as options that can be configured, such as language and pitch.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e8e4332ef05594591d852746c2025a78/href">https://medium.com/media/e8e4332ef05594591d852746c2025a78/href</a></iframe><ul><li>voiceschanged - This event listener can be used to attach an event to add voices to use.</li><li>getVoices() - Will extract the voices on the device being used as an array</li></ul><h3>SpeechSynthesis</h3><p>This is the controller interface for the speech service, which can be used to get information about the voices available, on your particular device.</p><p>It can also be used to start and pause the speech.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af3c61528a91ee76be5db87fa54f693e/href">https://medium.com/media/af3c61528a91ee76be5db87fa54f693e/href</a></iframe><p>Above, are example properties and methods that can be used to alter the state of the speech device.</p><h3>Anonymous function</h3><p>At times you may want to provide a parameter to a function to be used in an event listener. Unfortunately, doing this within a traditional function call will result in it being run on page load.</p><p>Using an anonymous function, you can avoid this problem</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc1edbe1dbeb010cfe8d3eb4c6597e1a/href">https://medium.com/media/fc1edbe1dbeb010cfe8d3eb4c6597e1a/href</a></iframe><p>One caveat to this is that a new function will be created. Relying on this approach can cause unnecessary overhead to your code, which could have negative implications on your websites speed and efficiency.</p><p><em>Originally published at </em><a href="http://gist.github.com/c82e8b5c6d720ffa7d058869b894bb81"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b3d1b2af08b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 (Day 22)]]></title>
            <link>https://medium.com/@usyyy/javascript-30-day-22-368dd8322ba2?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/368dd8322ba2</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript30]]></category>
            <category><![CDATA[junior-developer]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Tue, 22 Aug 2017 13:54:21 GMT</pubDate>
            <atom:updated>2017-09-07T07:49:36.666Z</atom:updated>
            <content:encoded><![CDATA[<h4>Follow Along Link Highlighter</h4><p>Demo can be found <a href="https://yhabib.github.io/JavaScript30/22%20-%20Follow%20Along%20Link%20Highlighter/index.html">here</a>.</p><p>What I learned on this mini-project.</p><h3>getBoundingClientRect()</h3><p>Used to return an elements sizes and position relative to the window.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7df3766d218d06b808ba468bca998851/href">https://medium.com/media/7df3766d218d06b808ba468bca998851/href</a></iframe><p>It returns an object, which represents the CSS borders associated with the element. The values returned are read-only and can not be updated, these include left, top, x and y.</p><p>Values represent the border-box in pixels and are relative to the top-left of the viewport (this doesn&#39;t apply to width and height values).</p><h3>scrollX and scrollY</h3><p>When the scrolling position changes, the values returned, will adjust to be bound, to the current top-left of the <strong>viewport</strong>. So, to make sure the values are bound to the top-left of the <strong>document</strong>, you need to add the distance scrolled via scrollX and scrollY, shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4cca94d5f2d0c5176b774cfa5404b688/href">https://medium.com/media/4cca94d5f2d0c5176b774cfa5404b688/href</a></iframe><p><em>Originally published at </em><a href="http://gist.github.com/03ef76407450758b98d3db76fae83a04"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=368dd8322ba2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 (Day 21)]]></title>
            <link>https://medium.com/@usyyy/javascript-30-day-21-40051e1fe225?source=rss-95a11fd0a3fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/40051e1fe225</guid>
            <category><![CDATA[geolocation]]></category>
            <category><![CDATA[javascript30]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[junior-developer]]></category>
            <dc:creator><![CDATA[Usmaan Ali]]></dc:creator>
            <pubDate>Mon, 21 Aug 2017 07:52:06 GMT</pubDate>
            <atom:updated>2017-08-21T07:52:06.548Z</atom:updated>
            <content:encoded><![CDATA[<h4>Geolocation</h4><p>What I learned on this mini-project.</p><h3>geolocation</h3><p>This is a property of the window object, that contains data about the users location. You must grant access for it to work.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/742d0150f3c6539932e54a80b3fa0499/href">https://medium.com/media/742d0150f3c6539932e54a80b3fa0499/href</a></iframe><p>The geolocation object is only introduced very briefly, in this project.</p><h3>watchPosition</h3><p>This method, allows you to update the users position at regular intervals, instead of getting periodic snapshots of their locations.</p><p>The data then needs to be manipulated through a promise, designed to handle successful or unsuccessful data retrieval.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3570b8294c4a3c975604d1721760d72/href">https://medium.com/media/a3570b8294c4a3c975604d1721760d72/href</a></iframe><h3>coords</h3><p>Most of the data that you will need is contained in this object. Examples of this include the latitude, longitude and heading (representing degrees from north).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0a0c95a1c401a66d0791699f41be10c/href">https://medium.com/media/c0a0c95a1c401a66d0791699f41be10c/href</a></iframe><p><em>Originally published at </em><a href="http://gist.github.com/2fec70ae96a19d1531bc04b1c54a9664"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40051e1fe225" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>