私はonmouseover、z-indexプロパティ、および一連のCSSクラスを使用してイメージの背後に隠れたテキストを表示しています。しかし、私のイメージは、上に乗ったときにすばやく点滅します。誰か助けてくれますか?onmouseover原因を点滅させる
<span class="displayer" onmouseover="this.className='hidden'" onmouseout="this.className='displayer'">
私のマークアップ:
問題がれるonmouseoutで、このラインである...私は問題を解決するためにそれを修正する方法がわからない(これは、ワードプレスのテーマです):
<?php get_header(); ?>
<div id="container">
<div id="portfolio_content">
<!-- Grab posts -->
<div id="portfolio_wrap">
<?php while (have_posts()) : the_post(); ?>
<!-- Get the image -->
<a href="<?php the_permalink() ?>">
<span class="img">
<span class="displayer" onmouseover="this.className='hidden'" onmouseout="this.className='displayer'">
<?php if (has_post_thumbnail()) { the_post_thumbnail('thmb-portfolio'); } ?>
</span>
<!-- Excerpt title -->
<span class="title"><?php the_title(); ?></span>
<!-- Excerpt description -->
<span class="desc">
<?php my_excerpt('short'); ?>
</span>
</span>
</a>
<?php endwhile; ?>
<!-- Next/Previous Posts -->
<?php if (function_exists("pagination")) {
pagination($additional_loop->max_num_pages);
} ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
マイCSS
#portfolio_content ul {
list-style:none
}
#portfolio_content .img a {
color:#444;
z-index:110!important
}
#portfolio_content .img a:hover { }
#portfolio_content .img {
display:block;
float:left;
height:250px;
margin:0 35px 35px 0!important;
overflow:hidden;
padding:0;
width:352px
}
#portfolio_content .img img {
display:block;
position:absolute!important;
z-index:100!important
}
#portfolio_content .img img:hover {
z-index:0!important
}
#portfolio_content .img .title, #portfolio_content .img .title a {
font-size:22px;
width:352px!important;
height:250px!impotant;
float:left!important;
text-align:center;
margin:100px 0 10px 0;
position:relative!important;
color:#444
}
.desc {
font-size:13px;
display:block;
text-align:center!important;
margin:0 auto!important;
width:352px;
color:#444
}
.displayer {
display:block;
background:#1a1a1a;
overflow:hidden;
width:352px;
height:250px;
z-index:900!important
}
.hidden { display:none }
画像にCSSスプライトを使用していますか? – Kyle
いいえ、提供されているコードとCSSはすべて使用していますが、点滅します。これはonmouseoutを次の行で修正することで解決できます:方法を知っている。 – siouxfan45
あなたのサイトにリンクを追加できますか? – thirtydot