Skip to content

Instantly share code, notes, and snippets.

@clauda
Created August 12, 2013 18:40
Show Gist options
  • Save clauda/6213728 to your computer and use it in GitHub Desktop.
Save clauda/6213728 to your computer and use it in GitHub Desktop.
Exemplo de manipulação do dom da galeria
$(function($) {
$(document).ready(function() {
var title = ''
, descr = '';
$('#pictures ul li').each(function(index) {
title = $(this).find('img').prop('title');
descr = $(this).find('img').data('description');
if(title) { $(this).append('<h4>'+title+'</h4>'); }
if(descr) { $(this).append('<p>'+descr+'</p>'); }
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment