Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
How can I pass the url as a variable on a click in clickfunnels?

I am trying to pass a variable to go to a certain url when I click a button. It is a clickfunnels member's area with lessons and I managed to go to the previous / next lesson. It also works if I specify a specific lesson like for instance #4-1.

However, I am now trying to pass a variable so that the link redirect to whichever lesson is specified in the url (which would be in the form of #section-lesson)

<script>
  $(function() {
    var lessonLinks = $("a.lesson-link[id!='temp-link']");
    var idx = [];
    lessonLinks.each(function(i) {
        idx[i] = this.id;
    });
    $(document).on("click","a[href='#next-lesson']",function (ev) {
        ev.preventDefault();
        var currIndex = $.inArray($('a.activeMemberNav').attr("id"),idx);
        $('a.lesson-link[id="'+idx[currIndex+1]+'"]').click();
        window.scrollTo(0,0);
    });
    $(document).on("click","a[href='#previous-lesson']",function (ev) {
        ev.preventDefault();
        var currIndex = $.inArray($('a.activeMemberNav').attr("id"),idx);
        $('a.lesson-link[id="'+idx[currIndex-1]+'"]').click();
        window.scrollTo(0,0);
    });
    $(document).on("click","a[href='#3-1']",function (ev) {
        ev.preventDefault();
        var currIndex = $.inArray($('a.activeMemberNav').attr("id"),idx);
        $('a.lesson-link[id="3-1"]').click();
        window.scrollTo(0,0);
    });    
    $(document).on("click","a[href='#lesson']",function (ev) {
        ev.preventDefault();
        var currIndex = $.inArray($('a.activeMemberNav').attr("id"),idx);
        $('a.lesson-link[id="#lesson"]').click();
        window.scrollTo(0,0);
    });    
  });
</script>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!