# easy-elements/1.3.1/assets/js/easy-wrapper-link.js

Easy Elements for Elementor – Addons &amp; Website Templates, version 1.3.1. 50 lines.

- Page: https://pluginprobe.com/plugins/easy-elements/1.3.1/code/assets/js/easy-wrapper-link.js
- Raw: https://pluginprobe.com/plugins/easy-elements/1.3.1/raw/assets/js/easy-wrapper-link.js
- Modified: 2026-01-26T10:13:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-elements/1.3.1/code/assets/js/easy-wrapper-link.js#L10-L20`.

```javascript
jQuery(document).ready(function ($) {
    'use strict';

    $('body').on('click', '.easyel-wrapper-link', function (e) {
        const $el = $(this);
        const settings = $el.data('easyel-wrapper-link');

        if (!settings || !settings.url) return;

        const url = settings.url.trim();

        if (url.startsWith('#')) {
            e.preventDefault();
            const target = $(url);
            if (target.length) {
                $('html, body').animate({ scrollTop: target.offset().top }, 600);
            }
            return;
        }

        if (url.startsWith('mailto:')) {
            window.open(url, '_self');
            return;
        }

        if (url.startsWith('tel:')) {
            window.open(url, '_self');
            return;
        }

        if (!/^https?:\/\//i.test(url)) return;

        e.preventDefault();

        const linkId = 'easyel-wrapper-link-' + $el.data('id');

        if ($('#' + linkId).length === 0) {
            $('<a/>', {
                id: linkId,
                href: url,
                target: settings.is_external ? '_blank' : '_self',
                rel: settings.is_external ? 'noopener noreferrer' : '',
                class: 'easyel-hidden-link'
            }).appendTo('body');
        }

        document.getElementById(linkId).click();
    });
});

```
