Javascript 使用jQuery在悬停和从左向右滑动时在Span中插入文本 吃饼干很有趣 var quotes=new数组('do what and','live life and','get funky and','do your thing and'); $('.site description').mouseover(函数(){ $('.description addition').text(引号[Math.floor(Math.random()*quotes.length)]; }).mouseout(函数(){ $('.description addition')。文本(“”); });
希望这就是你想要的 哎呀!从左向右滑出。相应地编辑。fadeIn(“慢”);淡出(“慢”);这似乎可以很好地使用,而且您在对齐方面没有任何问题。Javascript 使用jQuery在悬停和从左向右滑动时在Span中插入文本 吃饼干很有趣 var quotes=new数组('do what and','live life and','get funky and','do your thing and'); $('.site description').mouseover(函数(){ $('.description addition').text(引号[Math.floor(Math.random()*quotes.length)]; }).mouseout(函数(){ $('.description addition')。文本(“”); });,javascript,jquery,html,Javascript,Jquery,Html,希望这就是你想要的 哎呀!从左向右滑出。相应地编辑。fadeIn(“慢”);淡出(“慢”);这似乎可以很好地使用,而且您在对齐方面没有任何问题。 <p class="site-description">Its fun to <span class="description-addition"></span>eat cookies</p> <script> var quotes = new Array('do whatever
<p class="site-description">Its fun to <span class="description-addition"></span>eat cookies</p>
<script>
var quotes = new Array('do whatever and ', 'live life and ', 'get funky and ', 'do your thing and ');
$('.site-description').mouseover(function() {
$('.description-addition').text(quotes[Math.floor ( Math.random() * quotes.length )]);
}).mouseout(function() {
$('.description-addition').text("");
});
</script
<p class="site-description">Its fun to <span class="description-addition" style="display:none;"></span> eat cookies</p>
$(document).ready(function() {
var quotes = new Array('do whatever and ', 'live life and ', 'get funky and ', 'do your thing and ');
$('.site-description').mouseover(function() {
$('.description-addition').text(quotes[Math.floor ( Math.random() * quotes.length )]+' ').toggle("slow");
}).mouseout(function() {
$('.description-addition').toggle("fast");
});
});