Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Adding second on.("click") event on page

    General Discussion
    2
    5
    525
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      clineker last edited by

      Hi Guys,

      Just a quick question regarding adding a second link click using Jquery. As I recently found out that onclick="open('link')" does not work in IE or Microsoft Edge, I am trying to replicate this using Jquery. The onclick option works perfect on everything else however I ideally need this to work across all browsers.

      My issue is that this link sits within an accordion and so when the accordion is activated, the link within it is showing up when you hover over it however when you click on it, it just does not load and produces an error in inspector.

      The link is here - the example is on the first drop down and the second 'book now' link.

      My CSS for the 'book now' link is:

      jQuery(document).on("click", ".book", function(e) {
      e.preventDefault();
      var id = jQuery(this).attr('href');
      });

      And the HTML for the 'book now' link is

      <a href="https://www.onetournament.uk/booking-form" class="book">Book now</a>

      As always any help would be massively appreciated.

      Cheers

      Chris

      1 Reply Last reply Reply Quote 0
      • mariusjopen
        mariusjopen Global Moderator last edited by

        Dear @clineker

        can you not make a normal <a href> link ?

        Best!

        Marius

        www.mariusjopen.world

        1 Reply Last reply Reply Quote 0
        • C
          clineker last edited by clineker

          Hi @mariusjopen

          I have tried just a normal link however I have the same problem where it will show it is a link, however when you click on it, it does nothing and I get errors in inspector. I'm presuming this is because they are within the accordion?

          The below image is the error I'm getting if its any help?

          0_1525973759528_Screen Shot 2018-05-10 at 18.35.10.png

          Cheers

          Chris

          1 Reply Last reply Reply Quote 0
          • mariusjopen
            mariusjopen Global Moderator last edited by

            Dear @clineker

            can you try this accordeon?
            https://jsfiddle.net/mariusjopen/r63w9jfg/

            Best!

            Marius

            www.mariusjopen.world

            1 Reply Last reply Reply Quote 0
            • mariusjopen
              mariusjopen Global Moderator last edited by

              Of course you will still need to adjust the jQuery to the Laytheme:
              http://laytheme.com/documentation.html#custom-javascript

              Best!

              Marius

              www.mariusjopen.world

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Before you post

              Use the Search Feature. Maybe there is already a solution to your issue.

              1. Update Lay Theme and all Lay Theme Addons
              2. Disable all Plugins
              3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
              4. Now see if your problem solved itself
              5. Go here, see if your problem is listed here:
              Troubleshooting

              When you post:
              1. Post a link to where the problem is
              2. If the problem is difficult to explain, post screenshots / link to a video to explain it

              Thanks!

              Online Users

              F
              F
              C
              S

              Recent Topics

              • S

                Links don't work / pages don't show up

              • F

                New button feature not available

              • S

                Theme crashed - because of Polylang?

              • S

                fullscreen slider: slow load time + mobile: images dropping to bottom

              laytheme.com