Tag: fadein

jQuery,问题与.animate()和.fadeIn()

在div .frame里面我还有3个div: .middle , .middle和.bottom 。 .bottom和.bottom display none ,当鼠标位于.bottom上时,jquery函数为animate , .bottom的高度增加, .bottom和.bottom显示为.fadeIn() 。 当鼠标超出.bottom , .bottom的大小正在减小,而.bottom和.bottom将以.fadeOut()消失。 我的CSS是: .frame{ border-style: solid; border-width: 1px; width:200px; height:200px; position: absolute; top:50px; left:50px; } .middle{ width:200px; height:200px; position: absolute; top:0px; } .top{ display:none; background-color:red; width:100%; } .bottom{ position:absolute; display:none; bottom:0px; background-color:red; width:100%; } 我的HTML: top middle bottombottombottombottom 和我的jQuery: var […]

Fout Out / In Div页面加载

当我的网站上加载新页面时,我希望旧页面的主要内容(位于正文中的div内,以排除页脚和页眉)淡出,并且新页面的主要内容将淡入,都是通过使用jQuery。 我的代码基本上是: -random header info- (also where I figured the jQuery would go?) – main content of site – 我只希望淡出和影响: 我该怎么做?

将fadeIn和fadeOut效果添加到图像灯箱JQuery中

我有一个jQuery灯箱,用户点击两个链接’next’和’previous’来浏览图像。 如何淡入新图像? 这是我的代码片段,说明新图像如何替换旧图像。 var image = $(item).find(‘a’).attr(‘href’); $(‘#lightbox img#image’).attr(‘src’, image);

jQuery fadeOut没有改变显示属性

在http://judi.simpleupdates.com/上我试图使用jQuery fadeIn和fadeOut效果在页面上制作幻灯片。 这两个项目fadeIn没有问题。 但是, fadeOut不会更改应该消失的div的display属性。 任何想法为什么这可能没有按预期工作? 这是失败的线: $( “.carousel_item:nth-child(” + selected + “)” ).fadeOut(600); 更新:问题似乎是fadeOut在没有width和height的元素上。 将值添加到div.carousel_item的width和height属性时, fadeOut调用将正常工作。 另一种方法是从后代img移除position: absolute ,导致div增长到img维度。

简单的颜色FadeInhoverJquery与WordPress网站

我希望在我的WordPress网站http://www.threecell.com/demo中加入以下Jquery Snippet(颜色淡入淡出)。 下面的代码基于我如何将其适应当前菜单标签结构。 我在我的functions.php文件中加载了Jquery。 $(document).ready(function(){ //Set the anchor link opacity to 0 and begin hover function $(“#menu-sample-menu li a”).hover(function(){ //Fade to an opacity of 1 at a speed of 200ms $(this).fadeOut(0).addClass(‘hover’).fadeIn(300); //On mouse-off }, function(){ //Fade to an opacity of 0 at a speed of 100ms $(this).fadeOut(300) .queue(function(){ $(this).removeClass(‘hover’).fadeIn(0).dequeue() }); }); }); 相关的菜单样式包括在这里: #access { […]

我在哪里把jQuery .fade()函数放在ajax成功回调中?

我有一个ajax调用,它使用在成功回调中返回的html填充页面的一部分: function LoadCurrentCourses(masterKey, status) { status = ‘S’; $.ajax({ type: “GET”, url: “/Home/LoadCurrentCourses/?masterKey=” + masterKey + “&status=” + status, dataType: “html”, success: function (evt) { $(‘#currentCourses’).fadeIn(1500, function () { $(‘#currentCourses’).html(evt) }); }, error: function (req, status, error) { $(‘#currentCourses’).html(“Error occured retrieving current courses”); } }); } #currentCourses标记只有一个标题并在那里加载.gif文件。 Current Courses 从doc.ready()的主页面调用ajax: $(document).ready(function () { var masterKey […]

单击时用jquery替换img src

这可能看起来像是儿童游戏,但我无法弄清楚如何替换图像的src属性。 src是生成图像的“build.php”。 我想要的是当我点击“混合”它将运行build.php生成一个新图像,删除旧图像并显示一个漂亮的淡出/淡出的新图像。 还有一个“建立新图像”,它在新图像加载时隐藏。 我试过了 $(“#mix”).click(function(){ var img = new Image(); $(img).load(function () { $(this).hide(); $(‘#loader’).removeClass(‘loading’).append(this); $(this).fadeIn(); }).attr(‘src’, ‘build.php’); }); 但是第二次点击“混合”时,它会在旧图像下面放置新图像,而不是删除旧图像。

替代(窗口).scroll

可能重复: ScrollTop在Chrome中真的很生涩 我正在使用以下代码获取一个返回顶部按钮,并在用户滚动后导航淡入。 问题是每次滚动时它都会触发,因此导致滚动变得非常生涩。 是否有另一种方法可以执行此操作,这可能只触发一次该function? $(function () { $(window).scroll(function () { if ($(this).scrollTop() > 600) { $(‘#backToTop, #navigation’).fadeIn(); } else { $(‘#backToTop, #navigation’).fadeOut(); } }); }); });

jQuery幻灯片显示不同的延迟时间

我使用了Innerfade和Cycle,但我有几个div需要淡入,暂停和淡出,但我想以不同的速率暂停不同的幻灯片,因为有些内容会比其他幻灯片更多。 我没有看到我如何通过Innerfade或Cycle实现这一目标。 我尝试过这个,但所有事件都会立即触发。 Content1 Content2 Content3 Content4 Content5 $(“#slide1”).fadeIn(‘slow’); $(“#slide1”).delay(5000).fadeOut(‘slow’); $(“#slide2”).fadeIn(‘slow’); $(“#slide2”).delay(5000).fadeOut(‘slow’); $(“#slide3”).fadeIn(‘slow’); $(“#slide3”).delay(10000).fadeOut(‘slow’); $(“#slide4”).fadeIn(‘slow’); $(“#slide4”).delay(5000).fadeOut(‘slow’); $(“#slide5”).fadeIn(‘slow’); $(“#slide5”).delay(5000).fadeOut(‘slow’); 所以在这种情况下,我希望在5秒后淡出每张幻灯片,但幻灯片3应该保持10秒钟。 我怎么能做到这一点? 谢谢你提供的所有帮助!

Jquery图像fadein延迟X

如何让我的图像一个接一个地出现? 我目前正在使用Jquery fadein使我的图像淡化,但我希望它们在不同的时间开始。 无论如何我可以延迟图像淡入? 很快? $(document).ready(function(){ window.onload = function() { $(‘.fader1’).hide().fadeIn(3000); $(‘.fader2’).hide().fadeIn(9000); $(‘.fader3’).hide().fadeIn(6000); }; });