-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWordMasking.js
50 lines (49 loc) · 1.06 KB
/
WordMasking.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var plugin_insert=(function ($) {
$.fn.wordMasking = function (colorOptions) {
var defaultColor={
'default':'#fcc',
'background':'#fff',
'text':'#000'
}
var color = $.extend(defaultColor, colorOptions);
return $(this).css({
'background':color.default,
'color':color.default
}).hover(
function(){
$(this).css({
'background':color.background,
'color':color.text
});
},
function(){
$(this).css({
'background':color.default,
'color':color.default
});
}
).bind("touchstart",function(){
$(this).css({
'background':color.background,
'color':color.text
});
}).bind("touchend",function(){
$(this).css({
'background':color.default,
'color':color.default
});
});
}
});
if(!window.jQuery)
{
var script = document.createElement('script');
script.type = "text/javascript";
script.src = "http://code.jquery.com/jquery.js";
script.onload = function(){plugin_insert(jQuery)};
document.getElementsByTagName('head')[0].appendChild(script);
}
else
{
plugin_insert(jQuery);
}