4317 posts ThemeForest Reviewer
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Venezuela
  • Has been a member for 5-6 years
  • Envato Studio (Microlancer) Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor Reviewer says

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>
1012 posts
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Egypt
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
+1 more
wizylabs says

can you give out an example of how do you want the code to look like? im lil confused :D

4317 posts ThemeForest Reviewer
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Venezuela
  • Has been a member for 5-6 years
  • Envato Studio (Microlancer) Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor Reviewer says

Done! :)

3423 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 100 and 499 items
  • Referred more than 2000 users
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer moderator says

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.

by
by
by
by
by
by