Switching CSS classes or properties based on screen size can be achieved using JavaScript as shown below. But handling such things with JavaScript window resize event is not as efficient to achieve it with CSS. Using Tailwind For example, if we want to create a feature where the child menu opens on mouseenter event and
Category: JavaScript
Advance To A Particular Slick Slide or Center using slickGoTo
Posted onIn this blog, we will learn how to advance to a particular slide using slick carousel’s slickGoTo method. Step 1: Get the carousel Element and all the slide items. Step 2: Now get the current Slide. Step 3: Now using the currentSlideIndex move the carousel item position to the current index. Please note that this will always keep the
Common JavaScript Functions
Posted onEssential JavaScript functions that every developer should keep in their toolbox! …
Using Underscore JS _.template() in WordPress
Posted onMany times we come across a situation in JavaScript where we have to generate dynamic html You can see the code above looks messy and difficult to read. WordPress recommends to use underscore templates.WordPress already has support for underscore.js library. All you have you to do is enqueue it like so : Then you can create a template