Demo: 👉🏻 https://codepen.io/livehelp/pen/MWoNPqX?editors=1010
Just use an HTML or Code element in Elementor to paste in the code instead of a Button element.
<h2><a href="#smooth" onclick="window.open('https://downloads.wordpress.org/plugin/apk-downloader.zip')";>Click to Download + Smooth Scroll</a></h2>
<p>Insert enough text here to have a scoll bar.</p>
<div id="smooth"><h1>Tadaa! Jumps to this div based on the id #smooth onClick.<h1></div>
<script>
const links = document.querySelectorAll("a");
for (const link of links) {
link.addEventListener("click", clickHandler);
}
function clickHandler(e) {
e.preventDefault();
const href = this.getAttribute("href");
const offsetTop = document.querySelector(href).offsetTop;
scroll({
top: offsetTop,
behavior: "smooth"
});
}
</script>
Related Posts:
- How do I programatically empty trash?
- Primary and Secondary Button Classes
- How to insert a Button or custom text on twentyseventeen header
- Override admin submit_button() functionality
- Remove “Save draft” button without using CSS
- Remove Save Draft & Preview Buttions.. and also Statius: Draft & Visibility: Public
- Add multiple custom buttons with custom links after add to cart button for every product
- Loading elements with a button
- How to align Button on the right of the image on desktop but below the image on mobile
- How can I center the “Buttons” in the WordPresse editor?
- Add button to menu item at the same row
- NavBar Button Clicks (need 2 clicks rather than 1 click)
- Using button from the function submit_button() triggers alert
- Create Button Using Provided Code
- Back button to previous page and breadcrumbs
- Button to execute shorcode [closed]
- PayPal buttons not working after 4.2.4 upgrade
- Button not working?
- submit button not work
- How to add a button to custom post type’s posts-page
- TinyMCE Anchor Button not showing
- Remove border radius setting from the Gutenberg button block?
- Editing Screen: Make Update or Publish Button Follow The Page
- How to Make admin Sidebar Menu always be Collapse by code
- Quicktags on all textarea.. Not working on plugin?
- What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
- WYSIWYG – Getting the “link” button from HTML mode in Visual mode
- How to remove buttons from gutenberg toolbar
- Display “add to cart” button on every listing in product category page?
- Adding another “Add Post” button to admin
- How to align a single Gutenberg block button in WP 5.5.3?
- How can I create custom button in post.php
- Help add ajax load more button
- How to use radio buttons in WordPress plugin options using register settings?
- How to load javascript file on homepage in WordPress in order?
- Creating a Link Text like Submit Button in Admin Page
- CSS style button For WP Login Function in page template
- Adding TinyMCE buttons without removing plugin buttons?
- How can I center Gutenberg buttons on mobile?
- One button on admin page works but not two
- add media button is not working
- Change “add to cart” button color based on Woocommerce product category [closed]
- Add multisite switch button. Click to switch to other page in same admin area
- How can I implement shortcode on click event
- Why my image upload button is not working in wordpress widget area?
- Ajax Button to load more Posts into a timeline
- Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)
- Cannot enqueue jQuery correctly using Google CDN
- AJAX button action in foreach
- AJAX on Front-End Button Click not working – Custom Plugin
- Function won’t run onclick using Ajax
- magic “MENU” button under Twenty Twelve theme
- Is there a way to direct unregistered user to registration page when click a link?
- how to change the “return to shop” button text? [closed]
- Convert to shortcode?
- How to add custom ‘layout’ buttons to wordpress editor?
- Page menu not showing in admin, new Page button missing in toolbar too
- How to implement custom buttons into individual posts?
- TinyMCE: Move buttons from 2nd row to top row
- Share buttons Facebook Twitter, just like wordpress.com without webservice
- URL redirection
- how give a link to an Elementor Pro widget with variable part
- Button writing to MYSQL database
- Gutenberg button removed on save if its empty
- Add a product category to a specific product via a button
- Wordpres Tinymce custom button (Gavick guide)
- Send an e-mail on address with the link with disliked post
- Edited one page in my working menu and now all menu buttons don’t open unless I right-click and open in new tab
- Hide ‘add to cart’ when certain value in dropdown is selected
- Best practice to call a function from a button-link?
- Menu with sub-items but without link
- How to edit button permalink inside function.php using a child theme?
- How do I make a custom “Read More Blogs” button for my blog page
- How to add excerpt and read more button to category archive page
- Why are my button images blurry on mobile screens?
- How to execute certain code on back-end button press?
- Create Button for Shortcode in Text Editor
- creating different style CTA button in the menu
- Creating a simple button inside of a widget
- How to create 2 preview button in a post?
- wp_editor customization
- Eliminate menu collapse button on website
- Adding a button to a product if it’s in a category, then linking to that category
- disable publish button until condition is not met
- How to include backend buttons css on frontend?
- Customize TinyMCE Buttons
- Change text “My Basket” in woocommerce artificer theme
- Use radio buttons & checkboxes for post categories
- wordpress radio button on single post page
- A conditional button
- How to display a submenu as a popup when clicking a button?
- Add new MCE button for toggle specific cell background color
- Simple Share Buttons Add Plugin and Custom Post Type
- Facebook redirect buton
- add button to tinymce
- How can i add a random redirect button in wordpress? [closed]
- Can I turn an image into a button?
- Dynamic price for payment button
- How to use tag in wordpress?
- Add a custom code with custom link after add to cart for every product