首页 > 文本表单特效 / jquery特效插件 / > 文本渐变特效jquery插件textgrad

文本渐变特效jquery插件textgrad

点击: 3339 , 发布日期: 2011-12-6
文本渐变特效jquery插件textgrad

文本渐变特效jquery插件textgrad

一个可以实现 文本内容渐变特效的jquery插件textgrad,使用方法可以自定义多种参数,只是加了这个插件以后文本显示速度会有所影响。

参数说明:

begin(开如颜色)

a color expressed either as a String with 3 or 6 digits (the initial # being optional), or as an array of 3 numbers, as [125,0,241]. Values under 0 will be set to 0, above 25 to 255.

default : 'F00'

end(结束颜色)

a color, same as begin

default : '0FF' (yes, the default is ugly, you really have to change it)

colgrad

you can specify a color gradient more elaborate, in which case begin and end will be ignored. A color gradient is an array of objects following the pattern : {pc:number,col:color}
pc for percent : the percentage of the position of this color,
col for color : the value of the color at this place, specified as begin or end above.

default : generated by the program as begin color at 0% and end color at 100%

type(渐变样式)

the type of gradient you would like, can be either
'_' : horizontal gradient (begin or 0% is on the left-side),
'|' : vertical gradient (works for any text block, but pointless it has only one line...) (begin or 0% is on the top),
'o' : circled gradient, from (almost) the center of the block to the corners (begin or 0% is at the center),
'/' : from the bottom-left corner of the box to the right-top one (begin or 0% is on the bottom-left corner) (if the block has only one line, converted to '_'),
'\' or anything : form top-left corner to bottom-right corner (begin or 0% is on the top-left corner) (if the block has only one line, converted to '_').

default : '\'

spanize

number. Here I have to explain a bit how the gradient is made : it splits the text inside of the selected block into spans, then uses their relative position inside of the block to compute the css-color to be applied, given a distance function determined by the type of gradient. If you have already applied a gradient to that block, or spanized it before, it has already been splitted, no need to do it again, you would then put a negative value, like -1.

default : 1

spanClass

the class to be given to the spans generated

default : empty

maxGroup

the maximum number of characters each span created will contain. For small texts, like a title, put 1, for bigger texts it can become quite slow, so don't put 1. The quality of the gradient might be almost the same anyways if you don't have a very strong gradient. Note that maxgroup=50 is generally useless : at most the span contains a whole word, but no spacing character.

default : 3

cb

callback function after the gradient has been applied

default : none

因为是英文的有些不是挺别清楚,可以自己翻译一下。

关键词: jquery

注:用QQ登录后即可下载特效,当然你的积分是有限的,望好好利用与赚取!如何获得积分

我要评论
登录再评论
全部评论