User Tools

Site Tools


foundation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
foundation [2014/07/08 20:20] adminfoundation [2021/12/06 22:55] (current) – removed admin
Line 1: Line 1:
-====== Foundation ====== 
  
-===== Reveal Lightbox ===== 
- 
-**Description** 
- 
-Turn each a.lightbox into a Lightbox on click. 
- 
- 
-**Code** 
- 
-**HTML:** 
- 
-<code html> 
-<a href="BIG_IMAGE_URL" class="lightbox"> 
-  <img src="THUMBNAIL_IMAGE" /> 
-</a> 
-</code> 
- 
-**JS:** 
-<code javascript> 
-$('a.lightbox').click(function(event) { 
- event.preventDefault(); 
- var div = '<div id="lightbox" class="reveal-modal" data-reveal><img /><a class="close-reveal-modal">&#215;</a></div>'; 
- $(div).appendTo('body'); 
- var url = $(this).attr('href'); 
- $.ajax({ 
- url: url, 
- cache: true, 
- processData: false, 
- }).always(function() { 
- $("#lightbox img").attr("src", url); 
- $("#lightbox").foundation('reveal', 'open'); 
- }); 
-}); 
- 
-</code>