Not sure why this doesn’t seem to work, I can do it by ID’s with a hardcoded string for the description but when I try and do it more globally I can’t get it to work right. Basically when you hover over an image, a p(“desc”) slides down and should display a text string in it.
HTML
<div id="awardCont" class="bottomBlock">
<div id="award">
<div class="trophy" rel="foo"></div>
<div class="trophy"></div>
<div class="trophy"></div>
<p id="desc"></p>
</div>
</div>
I would appreciate any help.
The JS
$(function() {
$('.trophy').hover(function() {
var copy = $(this).attr(rel);
$('#desc').slideDown('fast').html(copy);
}, function() {
$('#desc').slideUp('fast');
});
});
Put
relin quotes: