jquery的flash效果 [英] flash effect with jquery

查看:106
本文介绍了jquery的flash效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用jQuery fadeIn和fadeout backgroud-color ,我尝试下面的代码,这会影响完整的div内容,我只需要为背景颜色添加flash效果。

I want fadeIn and fadeout backgroud-color using jQuery, I tried below code, It's affect the full div content , I need to add flash effect only for backgroud-color.

   $('.countbox').css("background-color","#FF0000").fadeIn("fast").delay(800)
    .fadeout("fast");
<div class="countbox">checkout</div>

我也尝试了这个但它不起作用!

I tried this on also but it's not working!

$('.countbox').css("background-color","#FF0000").fadeIn("fast").delay(800).css("background-color","#FFFFFF");

有什么问题可以帮助我!

What's the problem anyone can help me !

修改

哎呀!
我的答案不适用于所有窗口。哪一个只为当前窗口提供闪光效果,但我需要获得所有窗口的闪光效果。
例如: -
当我点击按钮时,它应该为我提供所有窗口div的闪光效果,就像在这个网站

推荐答案

如你在评论中提到的那样在单独的窗口中执行此操作,您需要进行某种回发服务器发出信号何时会发出信号。

to do this in separate windows as you're mentioning in your comments, you will need to have some sort of postback to a server to signal when this will happen.

扩展omerkirk的答案(这是执行此IMO的正确方法)。

extending omerkirk's answer (which is the correct way to do this IMO).

执行setInterval(function(){。get();});定期从存储当前状态的后台服务器获取信息(每个用户可能......)。当前状态发生变化时,你在当前窗口的背景上执行 .animate(); 以匹配后台服务器的那个......

do an setInterval(function(){.get();}); that periodicially gets information from some background server that stores the current state (per user probably...). When the current state changes, you do the .animate(); on the current window's background to match that of the background server...

如果你有多个驾驶窗口而不是一个主窗口和x个客户端窗口,这会变得非常棘手和有问题......

This can get very tricky and problematic if you have multiple 'driving' windows instead of just one master window and x client ones...

真的,这是一个坏主意IMO ......

Really this is a bad idea IMO...

这篇关于jquery的flash效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆