User Tools

Site Tools


foundation

Differences

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

Link to this comparison view

Next revision
Previous revision
foundation [2014/07/08 20:20] – created adminfoundation [2021/12/06 22:55] (current) – removed admin
Line 1: Line 1:
-====== Foundation ====== 
  
-**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> 
foundation.1404843606.txt.gz · Last modified: 2014/07/08 20:20 by admin