【发布时间】:2011-05-17 20:47:07
【问题描述】:
我正在尝试使用 JQuery 和 CSS 让用户在不同大小的图像“墙”中导航。
基本上,当用户将鼠标悬停在图像上时,我希望它展开(目前正在工作)并且我希望 div 也增加宽度,以显示一些额外的信息。出于某种原因,当我将鼠标悬停在这一点时,会有一些非常时髦的行为,当我鼠标移出时,图像会完全关闭。我有一种感觉,我在某个地方错过了一个“停止”,但我不知道在哪里。有人可以看看吗?
JQuery:
jQuery(function($){
$('.bar').mosaic({
animation : 'slide'
});
});
HTML:
<div class="MBT-CSS3">
<!--Bar-->
<div class="mosaic-block bar">
<a href="http://buildinternet.com/project/mosaic" target="_blank" class="mosaic-overlay">
<h4>This video is really cool! Click to watch more!</h4>
<p>by Media Innovation Team</p>
</a>
<!-- <img src="http://buildinternet.s3.amazonaws.com/projects/mosaic/mosaic.jpg"/> -->
<img src="img/grad1.png"/>
</div>
</div>
<div class="clearfix"></div>
CSS
.MBT-CSS3 div{
-webkit-transform:scale(0.7); /*Webkit 0.7 times the original Image size*/
-moz-transform:scale(0.7); /*Mozilla 0.7 times the original Image size*/
-o-transform:scale(0.7); /*Opera 0.7 times the original Image size*/
-webkit-transition-duration: 0.5s; /*Webkit: Animation duration*/
-moz-transition-duration: 0.5s; /*Mozilla Animation duration*/
-o-transition-duration: 0.5s; /*Opera Animation duration*/
/*opacity: 0.5;
z-index: 1;*/
position:relative;
overflow:hidden;
background-color:#000;
width: auto;
height: auto;
/*margin: 0 10px 5px 0; */
}
.MBT-CSS3 div:hover{
-webkit-transform:scale(1.1); /*Webkit: 0.5 times the original Image size*/
-moz-transform:scale(1.1); /*Mozilla 0.5 times the original Image size*/
-o-transform:scale(1.1); /*Opera 0.5 times the original Image size*/
/*box-shadow:0px 0px 30px gray;
-webkit-box-shadow:0px 0px 30px gray;
-moz-box-shadow:0px 0px 30px gray; */
opacity: 1;
z-index: 100;
width:600px;
/*height:250px; */
}
感谢任何可以提供帮助的人!!!!非常感谢您的宝贵时间!
【问题讨论】:
-
您使用的是 jQuery 插件?您可能想在您的问题中提及这一点。此外,发布JSFiddle 示例可能会为您提供更多帮助。
-
哇,这确实很时髦...我把它放在 jsfiddle 中玩。 jsfiddle.net/dlikhten/QqFrj/1
-
仅供参考,Dmitriy 发布的 JSFiddle 在 Safari 中运行不佳。至少可以说“时髦”……它到处乱跳。