Created
June 21, 2014 07:23
-
-
Save titopandub/56a029cb422c8165a4c6 to your computer and use it in GitHub Desktop.
Make any element can be click to go to another page using jQuery and data attribute (using data-link in this case)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(".slideshow img").each(function () { | |
| if ('' !== $(this).data('link')) { | |
| $(this).click(function (e) { | |
| window.location.href = $(this).data('link'); | |
| }); | |
| $(this).css('cursor', 'pointer'); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment