Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Adding second on.("click") event on page

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

Scheduled Pinned Locked Moved General Discussion
5 Posts 2 Posters 654 Views
  • 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 Offline
    C Offline
    clineker
    wrote on last edited by
    #1

    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
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @clineker

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

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • C Offline
        C Offline
        clineker
        wrote on last edited by clineker
        #3

        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
        0
        • mariusjopenM Offline
          mariusjopenM Offline
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          Dear @clineker

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

          Best!

          Marius

          www.mariusjopen.world

          1 Reply Last reply
          0
          • mariusjopenM Offline
            mariusjopenM Offline
            mariusjopen
            Global Moderator
            wrote on last edited by
            #5

            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
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            I also code custom websites or custom Lay features.
            šŸ’æ Email me here: šŸ’æ
            info@laytheme.com

            Before you post:
            1. When using a WordPress Cache plugin, disable it or clear your cache.
            2. Update Lay Theme and all Lay Theme Addons
            3. Disable all Plugins
            4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

            This often solves issues you might run into

            When you post:
            1. Post a link to where the problem is
            2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
            3. If the problem is difficult to explain, post screenshots / link to a video to explain it
            Online Users
            S
            sebagaga
            arminunruhA
            arminunruh
            Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
            laytheme.com
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Recent
            • Tags
            • Popular
            • Users
            • Search