Skip to content

Instantly share code, notes, and snippets.

@installero
Last active January 17, 2019 15:27
Show Gist options
  • Save installero/d5028228d903928f28afad8f6c0f6d60 to your computer and use it in GitHub Desktop.
Save installero/d5028228d903928f28afad8f6c0f6d60 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Lightbox 2 example</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.10.0/js/lightbox.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.10.0/css/lightbox.css"/>
<script>
$(document).on('click', '[data-alert]', function() { alert($(this).data('alert')); return false });
</script>
</head>
<body>
<a data-alert='Hi!' href='http://google.com'>This link will not open</a>
<a data-lightbox="example-set" data-title="<a data-alert='Hi!' href='http://google.com'>But this will</a>" href="https://www.fillmurray.com/500/500">
<img src="https://www.fillmurray.com/200/200">
</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment