Earlier I've written how you can enlarge an image on hover in Vue.js by dynamically toggling a CSS class. Here I'll show you how you can shrink or make an…
Make image circular on hover in Vue.js | Example
In the previous article, I've shown how you can enlarge an image on mouse hover. In this article, you'll learn how you can make an image circular (circular border radius)…
Enlarge an image on hover in Vue.js | Example
Vue.js with its super fast reactivity makes reactive development a breeze. Here in this example, you'll learn how you can enlarge or zoom in an image on hover in Vue.js.…
How to create non-reactive constants in Vue.js? | Example
Vue.js components come with the data() function which makes anything you put in it reactive. Now, let's assume that you have some string constants in a separate file which you…
Time duration rounded quarterly in JavaScript | Example
Sometimes, we may need to round off time or duration, on quarterly basis. The below table explains it better: Actual timeQuarterly rounded00:1200:1501:0701:0002:2502:3000:5201:0000:0400:00 To round the time or duration quarterly, you…
Format a number to 2 decimal places without rounding off | JavaScript | Example
Here you'll learn how you can format a number to 2 decimal places without rounding it off. By default, the toFixed() method would round off the number to the specified…
Format a number to 2 decimal places in JavaScript | Example
In JavaScript, you can use the toFixed() method to specify the number of digits you want after the decimal place. So, you can simply pass in 2 to toFixed() lead…
Add zero padding to numbers in JavaScript | Example
Sometimes you'd want to fill in digits with zeroes instead of nothing when showing time or something similar. For instance, you'd probably want to show 12:05 instead of 12:5 for…
Convert string to number in JavaScript | 5 ways | Example
Earlier we've seen 6 ways to convert a number to a string in JavaScript. Now, let's have a look at how you can convert a string to a number in…
