【发布时间】:2013-01-15 08:33:21
【问题描述】:
当你用鼠标移动它时,我想更改一些文本 bij 用 url 替换它。 我知道您无法通过使用动画(用于 css)来更改它,这就是我使用淡出的原因。 花了几个小时后,我仍然无法弄清楚为什么它不起作用。
我还想要页面中心的整个 div,我尝试了 valign 等,但这也不起作用。这不是优先事项,但最好替换 margin-top
<div align="center" style="margin-top: 20%;">
<div id="change">
<p id="big">Welcome!</p>
</div>
<img src="pic.JPG" alt="Logo" width="40%" height="90"/>
</div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$("#change").hover(
function(){
$(this).find('p').fadeOut('slow', function() {
$(this).text('<a href="Index.html">Continue</a>').fadeIn('slow');
});
},
function(){
$(this).find('p').fadeOut('slow', function() {
$(this).text('Welcome').fadeIn('slow');
});
});
</script>
提前谢谢!
【问题讨论】: