601 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
SparkyFlash
says

Thanks for pointing this out. Here’s a quick fix for the problem:

Use data-rel in HTML and then use jQuery to change the data-rel to rel attribute:

$('selector goes here a').each(function() {
        $(this).removeAttr('data-rel').attr('rel', 'prettyPhoto');
});

Validates perfectly :) Hope this will help someone.

15 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $5,000+ on Envato Market
  • Sells items exclusively on Envato Market
dbooom
says

This one is more flexible in my opinion:

$('a[data-rel]').each(function() {
    $(this).attr('rel', $(this).attr('data-rel')).removeAttr('data-rel');
});
2261 posts
  • Became a Top 20 Author of the Month
  • Created a helpful tool/app using the Envato API
  • Created a helpful tool/app for Envato Market users
  • Had an item that was trending
+14 more
revaxarts
says

Hey Guys!

Since jQuery 1.4.4 this is working:
<a data-rel="somedata"></a>

$('a').data('rel') == "somedata";

So no need for removeAttr()

253 posts
  • Has sold $5,000+ on Envato Market
  • Has referred 10+ members
  • Located in Sweden
  • Sells items exclusively on Envato Market
+2 more
graphic_dev
says
dbooom said
This one is more flexible in my opinion:
$('a[data-rel]').each(function() {
    $(this).attr('rel', $(this).attr('data-rel')).removeAttr('data-rel');
});
Thanks guys, this worked for me (using prettyPhoto).
by
by
by
by
by
by