Tips for converting an Elementor section into a clickable button

Link:

I have a section on my website that I want to turn into clickable buttons. Using WordPress with the Elementor plugin, I have already added some custom CSS to make it appear clickable, but now I need to add the actual functionality. I know that JavaScript is required for this, but I am hesitant as I lack the skill and knowledge in coding. I don't want to risk messing up the site by adding code randomly.

If anyone familiar with Elementor can assist me, here's where I'm stuck: Where should I add the JavaScript? There doesn't seem to be a specific place like there is for CSS. Should I use the Customizer (Appearance --> Customize --> Custom CSS/JS) or install a plugin for custom JavaScript? I have assigned each element a custom class which could be used for attaching JS.

After giving it more thought, I believe adding the JS in the Customizer might not be the best approach. My understanding is that any CSS/JS added there should only affect the topbar, header, and footer sections since they appear consistently on all pages. This leaves me considering using a JS plugin. Is this the most effective solution?

I'm seeking advice on the best method to achieve what I need. Understanding the Elementor Developer Docs is beyond my current level of expertise, so I'm turning to the community for assistance.

Thank you in advance for any help.

Answer №1

If you're familiar with JavaScript, one way to achieve this is by dragging and dropping an HTML widget and inserting your script between the script tags.

I suggest placing the HTML in your footer (created with Elementor) so that the script will be accessible throughout the entire site.

Answer №2

I've discovered a clever method to achieve this using only CSS, without the need for any plugins or JavaScript:

To begin, we must establish a minimum height for our Section/Column (I have chosen 50vh);

Next, we need to insert an element that contains a link or anchor tag (such as the Title Widget) and assign a CSS class to it (in my case, .mhdizmni_title);

Then, we can apply the following CSS code:

.mhdizmni_title a:after {
content: "";
display: block !IMPORTANT;
position: absolute;
height: 50vh;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
}

Answer №3

After stumbling upon this method, I believe I have found a solution that doesn't rely on any plugins and only requires minimal CSS code. Let me share the details below...

I managed to transform a simple column into a button-like element using borders and margins, then applied some CSS for a hover effect. Here's the code snippet:

selector:hover > .elementor-widget-wrap {
background-color: #d3d3d3;
}

selector:hover {
transform: translateY(-5px);
transition: transform 0.3s ease-out;
}

selector {
transition: transform 0.3s ease-in;
}

selector:not(:hover) {
transform: translateY(0);
}

To customize the hover effect, simply change the hex color at the beginning and adjust the transition values for the lift effect. Remember to add this custom CSS to the COLUMN widget, not its content (such as text or emojis).

In my case, I used a heading widget within an inner section of the column to create the button appearance. However, the link was clickable only when hovering over the text. To make the entire box clickable, apply the following CSS to the HEADER widget instead:

selector {
cursor: pointer;
}
selector a {
display: block;
height: 100%;
width: 100%;
}

If you encounter formatting issues, I have shared the properly formatted code in a Google Doc here: Google Doc Link

I've also created a YouTube video explaining this technique in detail. Feel free to watch it for a more visual explanation: YouTube Video Link

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am facing an issue with my react-app where it compiles successfully without any errors, but it is not rendering any elements

JavaScript file to run with npm start: import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter as Router } from 'react-router-dom'; import Routes from './routes'; ReactDOM.render( <R ...

What is the most efficient way to submit a form without reloading the page, all while accounting for the PHP script

I have been assigned the task of working on a loan calculator located at loancalc.000webhostapp.com. While browsing through other pages on the same site, I came across a question about submitting a form without reloading the page. However, this informatio ...

Adjustment to website design when decreasing browser size

As I decrease the size of the browser window, I notice that the top and bottom footers begin to shrink, causing the content within them (such as the navigation bars) to overlap with the main text. Can anyone explain why this happens? I apologize if my qu ...

Press the button located within the canvas element

How can I click on the verify button embedded inside a canvas element using either jQuery or Selenium? https://i.sstatic.net/F2CAY.png Please advise me on how to successfully click inside the canvas. ...

Clicking a button opens a new window, except when using the .onclick() method

My current situation involves using software that generates all the HTML/XML code for me, so I don't have direct access to it. I've created a button that is intended to open a form in a new window. Strangely, when I physically click on the button ...

Unlocking the Potential of Checkbox Values in AngularJS

I am attempting to extract data from a $rootScope object that has been linked to the checkboxes. HTML: <tr ng-repeat="system_history in SystemHistoryResponse.system_history"> <td><input type="checkbox" ng-model="versionValues[system_histor ...

Is there a way for me to prevent a particular file from being cached by web browsers?

Is there a way to prevent Web Browsers from caching a particular file? For example: <img src="myImage.jpg" cache="false"></img> If possible, how can this be achieved? The code <meta http-equiv="cache-control" content="no-cache" /> ins ...

Error in JSON format detected in cross-origin request

My code snippet: $.getJSON('http://../id=1397391950253&callback=?', null, function (results) { alert('Successfully achieved a cross domain JS call'); }); The result obtained is as follows: { "data": [{ "s ...

Unlocking the secrets of parsing JSON within a script tag using Laravel and AngularJS

I am facing some confusion as I attempt to use JSON with Angular and Laravel (v5.2.11) Here is my plan: 1. Send JSON to a blade file 2. Retrieve JSON within a script tag and assign it to a variable 3. Display each data In order to avoid duplicating ...

Use a swipe gesture to move through the slideshow on a touchscreen device

I am currently working on a slideshow that allows users to navigate through images by clicking either the next or previous buttons. When a user clicks on one of these buttons, the next or previous image is loaded into the img src, as shown below. In addit ...

arrange according to a specific sequence

I have been working on developing a JavaScript card game. I am looking for a way to match four consecutive numbers in a list. Currently, I have a loop structure that seems complex: cards = [{card:'h7'},{card:'c8'},{card:'h ...

Troubles with Flex wrap in CSS3 on iOS 10.3.2 browsers (Chrome and Safari)

Before sending me to other similar questions, keep in mind that I have already gone through them, attempted the solutions, and they are not resolving my issue. The problem I am encountering involves the flexbox layout. I am using the flexbox layout for ce ...

Sorting a list based on user-defined criteria in Ionic 3

Currently working on a project using Ionic and Firebase, I am faced with the task of comparing arrays produced by users with those stored in Firebase. This comparison is essential for filtering a list of products. The user can reorder a list containing 3 ...

Using 'interface' declarations from TypeScript is unsupported in JS for React Native testing purposes

I have a ReactNative app and I'm attempting to create a test using Jest. The test requires classes from a native component (react-native-nfc-manager), and one of the needed classes is defined as follows export interface TagEvent { ndefMessage: N ...

"Experiencing a problem with Next.js 13 where the User Context is not functioning properly outside of _app

When using Next.js 13 and the user context, I've noticed that it doesn't function properly outside of _app.tsx. Any idea why? src>context>UserPositionContext.tsx import { createContext, useContext, useState } from "react"; const ...

Tips for effectively utilizing innerHTML in this particular scenario

For an assignment, we were tasked with creating a Madlib game where users input words into textfields to replace certain words in a hidden paragraph within the HTML using JavaScript and CSS. The paragraph embedded in the HTML page is as follows: <span ...

The website functions properly in Chrome, but encounters issues in IE

Currently working on validating some JavaScript code. Chrome seems to be handling it well, but as expected, IE is causing some issues. Take a look at the code below: function validateData(a,id){ var inputs = document.getElementsByName('attname[] ...

Merge ReactCssTransitionGroup with React-route's Link to create smooth page transitions

React.js I'm facing an issue with the React.js code provided below. My goal is to set up the animation before transitioning to a new page using "React-router.Link" and ReactCSSTransitionGroup. Version: react: '15.2.1' react-addons-css-trans ...

The contents of my div extend beyond the border-radius

Here is the issue I'm facing: My challenge involves having an <h1> nested inside a <div>. However, when I apply a border-radius to the <div>, the <h1> appears outside of the div. Below is the code snippet: <div class="test ...

What is the most efficient way to implement OR conditions in JavaScript for shorter code

Hello there! I have a question about optimizing conditions in code. Is there a more elegant way to write the following conditions? state === 'su' || state === 'ja' || state === 'fa' I was thinking if it could be simplified ...