- Envato Staff
- Reviewer
- Community Moderator
- Venezuela
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
Hey see the snippet below , I need to grab the rel attribute via jQuery and generate a list of links to generate my thumbnails dynamically and append those thumbs to a div. Any idea?
<div id="fullSlider"> <ul> <li><a href="img/slides/1.jpg" title="Some Title" class="slide" rel="img/slides/thumb/1.jpg">1</a> </li> <li><a href="img/slides/2.jpg" title="Some Title" class="slide" rel="img/slides/thumb/2.jpg">2</a> </li> <li><a href="img/slides/3.jpg" title="Some Title" class="slide" rel="img/slides/thumb/1.jpg">2</a> </li> <li><a href="img/slides/4.jpg" title="Some Title" class="slide" rel="img/slides/thumb/1.jpg">3</a> </li> </ul> </div>
[So I can have something like this]
<div id="showthumbs"> <li><img src="thumb-1.jpg" alt="" /></li> <li><img src="thumb-2.jpg" alt="" /></li> <li><img src="thumb-3.jpg" alt="" /></li> <li><img src="thumb-4.jpg" alt="" /></li> </div>
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Egypt
- Exclusive Author
- Has been a member for 2-3 years
- Item was Featured
- Referred between 10 and 49 users
- Sold between 10 000 and 50 000 dollars
can you give out an example of how do you want the code to look like? im lil confused 
- Envato Staff
- Reviewer
- Community Moderator
- Venezuela
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
Done! 
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
Well, you can grab the rel attribute using attr('rel'), so you could do something like this:
var $thumbs = $('<div id="showthumbs"></div>');
$('#fullslider ul li a').each(function(k, el){
var $li = $('<li></li>');
var src = $(this).attr('rel');
$li.append( $('<img />').attr('src', src) );
$thumbs.append($li);
});
But I’m not sure how you want to do the translation from slide rel to thumb src.
