【发布时间】:2015-09-16 04:11:01
【问题描述】:
我有一个带有链接的列表,所以,如果我悬停一个链接,我想改变包含链接的背景颜色,它的颜色是哪个类是 '.secctabla' 。
我正在尝试这样做(也使用与 jQuery 集成的 velocity.js),但它不起作用(我也使用 parent(),但它也不起作用):
<tr class="secctabla">
<td>
<h3 class="linkCursos"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php
$argumentos = array(
//default to current post
'post' => 0,
'before' => '<p class=\"meta\">',
//this is the default
'sep' => ' y ',
'after' => '<p class=\"meta\">',
//this is the default
'template' => '%s: %l.'
);
?>
<?php the_taxonomies($argumentos); ?>
</td>
<td>
<?php $desc = get_post_custom_values("descripcion");
if (isset($desc[0])) { ?>
<p class="small"><?php echo $desc[0]; ?></p>
<?php } ?>
</td>
</tr>
$('.linkCursos a').hover(function() {
$(this).closest("secctabla").velocity({background: '#000000'});
})
【问题讨论】:
-
"secctabla"正在寻找一个不存在的<secctabla>元素;您正在寻找具有该类名的元素,并且应该使用:".secctabla"。
标签: jquery velocity.js