"active“类应该使导航项目发光。
http://kevinmikol.com/dmi/home
(function($) {
var currentRadius, multiplier;
function parseOptions(options) {
return {
RADIUS: (options.radius || 20),
DURATION: (options.duration || 500),
TEXT_COLOR: (options.textColor || '#fff'),
HALO_COLOR: (options.haloColor || '#777')
}
}
function currentRadius(elem) {
if (prop = elem.style['text-shadow']) {
return parseInt(prop.match(/0 0 (\d+)px/));
} else {
return 0;
}
}
function stepTextShadow(fx) {
if (fx.state == 0) {
fx.start = currentRadius(fx.elem);
}
updatedRadius = fx.end.begin ?
parseInt(fx.end.radius * fx.pos) :
parseInt(fx.end.radius - (fx.end.radius * fx.pos))
if (fx.end.begin || (fx.state < 1)) {
$(fx.elem).css('text-shadow', fx.end.color + ' 0 0 ' + updatedRadius + 'px');
} else {
$(fx.elem).css('text-shadow', $(fx.elem).data('glow.originalGlow'));
}
}
function addGlow(opts) {
var opts = parseOptions(opts || { });
function startGlow() {
$(this).stop().animate({
color: opts.TEXT_COLOR,
textShadow: {
begin: true,
color: opts.HALO_COLOR,
radius: opts.RADIUS
}
}, opts.DURATION);
}
function startFade() {
$(this).stop().animate({
color: $(this).data('glow.originColor'),
textShadow: {
begin: false,
color: opts.HALO_COLOR,
radius: opts.RADIUS
}
}, opts.DURATION);
}
with($(this)) {
bind('mouseenter', startGlow);
bind('mouseleave', startFade);
data('glow.originColor', css('color'));
data('glow.originalGlow', (css('text-shadow') || 'none'));
}
return this;
}
$.fx.step['textShadow'] = stepTextShadow;
$.fn.addGlow = addGlow;
})(jQuery);发布于 2012-09-23 10:57:16
据我所知。当鼠标悬停在被单击的页面上时,发光消失了,这是因为当鼠标悬停在li类中的a标记上时,active获得了属性display none。因此,如果您添加了一个脚本,以便每次悬停导航选项卡时,都可以检查li is active的类是否处于活动状态,您可以使用
$('.active').find('a').attr('style','');当然,您已经使用css给出了active类的样式。但是内联样式将始终覆盖css样式。
希望这能有所帮助。
https://stackoverflow.com/questions/12549265
复制相似问题