Viewing 3 replies - 1 through 3 (of 3 total)
  • There’s not a way to specify a custom onclick function per link, but you should be able to handle this with jQuery if necessary, something like (not tested):

    jQuery('#gallery-2 a[href$="some-url.com"]').click(function(){
      someFunction('some/background/image.jpg');
    });
    
    function someFunction(bgImage) {
     // Code to swap bg image for a link
    }

    You may find this link helpful:

    https://stackoverflow.com/questions/303956/select-a-which-href-ends-with-some-string

    Or, instead of passing a background image, you could apply the same function to all gallery links, and use a standard naming convention like “bg-image.jpg” and “bg-image-click.jpg” so you wouldn’t have to have custom function calls for each image.

    Good luck!

    In the new version 1.10.0 you can add additional css classes to the links around the images, so hopefully that may help you when adding onclick effects via javascript.

    Thread Starter arttek

    (@arttek)

    Hey ??

    Thanks to you I can now call classes with js !

    Simple, effective…as your support !

    Thanks for this plug in and for your updates !!

    Ken

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add onclick to urls’ is closed to new replies.