Created
August 12, 2022 09:31
-
-
Save herbie4/9ef5e81b64c5f07f05b9f8c0377ff1d9 to your computer and use it in GitHub Desktop.
hhdev Avada get url parameter to open modal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getParameter(p) | |
{ | |
var url = window.location.search.substring(1); | |
var varUrl = url.split('&'); | |
for (var i = 0; i < varUrl.length; i++) | |
{ | |
var parameter = varUrl[i].split('='); | |
if (parameter[0] == p) | |
{ | |
return parameter[1]; | |
} | |
} | |
} | |
jQuery(document).ready(function ($) { | |
var name = getParameter('modal'); | |
if(name = 'wholesale') $('.fusion-modal-text-link').click(); | |
#console.log(name); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment