Apply Different CSS Styles Based On Window Size (Responsively) Without Using JavaScript Window Event

Apply Different CSS Styles Based On Window Size (Responsively) Without Using JavaScript Window Event

Posted on

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

Read More

Advance To A Particular Slick Slide or Center using slickGoTo

Advance To A Particular Slick Slide or Center using slickGoTo

Posted on

In 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

Read More

Using Underscore JS _.template() in WordPress

Using Underscore JS _.template() in WordPress

Posted on

Many 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

Read More