0
请打开这个网站jQuery的:鼠标悬停无法正常工作
http://intelmarketing.mk/demos/security/
,并在该网站的底部用鼠标在走,你会看到3个图像与标题
现在试着用鼠标去标题,它假设显示红色框。我对最后一个标题有问题。当我去最后一个标题的jQuery脚本不起作用,我不知道为什么你们可以看到并帮助我,我做错了什么?
这里是代码:
<?php
$recentPosts = new WP_Query();
$recentPosts->query('showposts=3');
?>
<?php
while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<div class="box">
<div class="slice">
<?php echo get_the_post_thumbnail($post_id, $size, $attr); ?></div>
<script>
jQuery('.titlebox1').hover(function()
{
jQuery(this).find('.posttext').fadeIn(500);
jQuery(this).find('.titlebox').fadeOut(500);
},function()
{
jQuery(this).find('.posttext').fadeOut(500);
jQuery(this).find('.titlebox').fadeIn(500);
});
</script>
<div class="titlebox1">
<h3 class="titlebox"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="posttext">
<h3 class="date"><?php the_time('M d, Y') ?></h3>
<?php the_excerpt(); ?>
</div>
</div>
</div>
<?php endwhile; ?>
谢谢!
能否请您指导我这个问题 - http://stackoverflow.com/questions/36394371/add-javascript-in- wordpress-functions-php-with-wp-enqueue-script/36395004?noredirect = 1#comment60407943_36395004因为它与此类似。 –