这段代码在IE中淡化div。在Firefox 3.0.8中,淡入时间过去了,div即刻消失。我找不到任何人提到这个问题。jquery淡入淡出效果不能在FF中工作
$(function() {
$("#show").click(function() {
$("#show").fadeOut('slow');
});
});
<div id="show">this is where to show it</div>
这段代码在IE中淡化div。在Firefox 3.0.8中,淡入时间过去了,div即刻消失。我找不到任何人提到这个问题。jquery淡入淡出效果不能在FF中工作
$(function() {
$("#show").click(function() {
$("#show").fadeOut('slow');
});
});
<div id="show">this is where to show it</div>
感谢您的帮助。
我发现了这个问题。我的例子并不完整。我还为jQuery VS intellisense添加了jquery-vsdoc.js
。考虑到这一点使其工作。
我用这一招对于未来的读者
<%if (false) { %>
<script src="common/jquery-vsdoc.js" type="text/javascript"></script>
<% } %>
奇怪。
它在Firefox 3.0.8和Windows XP上为我工作。
为我工作,以及
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript">
</script>
<script type="text/javascript">
$(function() {
$("#show").click(function() {
$("#show").fadeOut('slow');
});
});
</script>
<div id="show">this is where to show it</div>
我一直都撞早上我的头这个问题,终于找到了我的问题... 标题为“脚本/ jQuery的1.3.2-vsdoc.js”
/* * This file has been commented to support Visual Studio Intellisense. * You should not use this file at runtime inside the browser--it is only * intended to be used only for design-time IntelliSense. Please use the * standard jQuery library for all production use. * * Comment version: 1.3.2a */
当他们说“你不应该在浏览器中运行时使用此文件”,他们当然不意味着它...
所以一定要确保你正在使用jQuery和jQuery分钟
我的非-vsdoc版本我的头撞了一下很长一段时间。我的代码甚至与jquery-vsdoc.js没有任何关系。
解决方案:只需关闭浏览器,重新打开它,再次加载页面。
不知道为什么它不工作。
不要让自己像我一样疯狂!
我的问题是,我试图先在CSS中做动画,并留下这在jQuery中造成问题。
transition:.5s linear;
你必须把event.preventDefault()放在那里才能使它工作。
$(function() {
$("#show").click(function(event) {
event.preventDefault();
$("#show").fadeOut('slow');
});
});
<div id="show">this is where to show it</div>
我实际上已经简化了这个问题。我根本无法在Firefox 3.0.8中获得任何fadeOut。我在搜索时没有看到有关此问题的任何信息。 – Kyle 2009-04-14 16:05:16