$.getScript("http://xoxco.com/projects/code/rainbow/rainbow.js",function(){
$('a[href="/u1"] strong').html(function(){
$(this).rainbow({
colors: [
'#FF0000',
'#f26522',
'#fff200',
'#00a651',
'#28abe2',
'#2e3192',
'#6868ff'
],
animate: true,
animateInterval: 100,
pad: false,
pauseLength: 100,
});
});
});
那是我的脚本,有没有办法选择多个名称?
('a[href="/u1"] strong','a[href="/u2"]')
有点像?
想出了一个小修复::
$.getScript("http://xoxco.com/projects/code/rainbow/rainbow.js",function(){
var a = $('a[href="/u1"] strong,a[href="/u33"]');
a.addClass('.rainbow');
$('.rainbow').rainbow({
colors: [
'#FF0000',
'#f26522',
'#fff200',
'#00a651',
'#28abe2',
'#2e3192',
'#6868ff'
],
animate: true,
animateInterval: 100,
pad: false,
pauseLength: 100,
});
});
虽然它没有添加实际的彩虹效果......任何建议。我会做一个jsfiddle
请帮忙