jquery淡入淡出_使用jQuery淡入淡出链接:dwFadingLinks

jquery淡入淡出

UPDATE: The jQuery website was down today which caused some issues with my example. I've made everything local and now the example works.

更新:jQuery网站今天关闭,这导致我的示例出现了一些问题。 我已经将所有内容都本地化了,现在该示例起作用了。

Earlier this week, I posted a MooTools script that faded links to and from a color during the mouseover and mouseout events. My thought was "why do a harsh a:hover color change when you can fade to that color?" Here's how to implement link color fading using jQuery.

本周早些时候,我发布了一个MooTools脚本,该脚本在mouseover和mouseout事件期间淡化了与颜色之间的链接。 我的想法是“为什么当您可以淡入淡出的颜色时,它会剧烈改变颜色?” 这是使用jQuery实现链接颜色淡入的方法。

jQuery JavaScript-插件和用法 (The jQuery JavaScript - Plugin & Usage)


/* plugin */
jQuery.fn.dwFadingLinks = function(settings) {
	settings = jQuery.extend({
		color: '#ff8c00',
		duration: 500
	}, settings);
	return this.each(function() {
		var original = $(this).css('color');
		$(this).mouseover(function() { $(this).animate({ color: settings.color },settings.duration); });
		$(this).mouseout(function() { $(this).animate({ color: original },settings.duration); });
	});
};

/* usage */
$(document).ready(function() {
	$('.fade').dwFadingLinks({
		color: '#008000',
		duration: 700
	});
});



翻译自: https://davidwalsh.name/fading-links-jquery-dwfadinglinks

jquery淡入淡出

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值