• dear community,

    i have a problem with a wordpress-site, which i can’t solve. Maybe you have any tips for me. Is it possible to trigger the first element of an lightbox-group-link (ModuloBox Plugin) from the wordpress menu? The links are like this:

    <a id="nomestart" class="mobx" href="https://www.testurl.at/testbild.jpg" data-rel="nomegroup"><img class="alignnone wp-image-1829" src="https://www.testurl.at/testbild.jpg"/></a>

    I thought, i can trigger the link with the ID #nomestart with javascript, but it doesn’t work for me or i miss something. i tried serveral things (Plugin JinMenu, different scripts in the header,…). Any tips ?

    regards, david

    • This topic was modified 3 years, 10 months ago by davidkurz.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Sure – did you add the jQuery and the Lightbox to your page ?
    Suggest making sure it works in a “regular page” before adding to the menu.

    This is a different plugin, but the theory should apply the same way :
    https://lightbox.tipsandtricks-hq.com/open-lightbox-from-wordpress-menu/

    There is also other approaches to use a shortcode in a cusomt link :

    which you could use from ModuloBox

    Moderator bcworkz

    (@bcworkz)

    I believe what triggers the lightbox is the data-rel attribute value. I’m unsure if there are additional requirements. You could modify the normal nav menu element’s anchor tag to include the attribute through the “wp_nav_menu” filter. Use str_replace() to find a distinct sub-string in the target tag and replace it with the same + the required attribute.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trigger Lightbox from Menu?’ is closed to new replies.