├── LICENSE ├── README.md ├── index.html ├── title.js └── title.min.js /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Arkaprava Majumder 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TITLE.JS 2 | ======= 3 | Browser Title Bar Manipulation JavaScript Library With No Dependency. 4 | ------- 5 | 6 | Demo, Usage & Details : http://arkaindas.github.io/titlejs 7 | ======= 8 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title JS 5 | 6 | 15 | 67 | 68 | 69 |
70 |
71 |

TITLE.JS

72 |

Browser Title Bar Manipulation JavaScript Library With No Dependency.

73 |
74 |
75 |

Download

76 | Compress, Production ( 1.2kb )Uncompress, Developement ( 1.4kb ) 77 |
78 |
79 |

Usage

80 |
81 |

Add Prefix

82 |

Example:

83 |

84 |

 85 | <script>
 86 | 	Title.pref("(2)");
 87 | </script>
 88 | 			
89 |

90 | Click To See On Title BarRefresh 91 |
92 | 93 |
94 |

Add Suffix

95 |

Example:

96 |

97 |

 98 | <script>
 99 | 	Title.suf("(2)");
100 | </script>
101 | 			
102 |

103 | Click To See On Title BarRefresh 104 |
105 | 106 |
107 |

Change Predefined Title

108 |

Example:

109 |

110 |

111 | <script>
112 | 	Title.change("Changed Title");
113 | </script>
114 | 			
115 |

116 | Click To See On Title BarRefresh 117 |
118 | 119 |
120 |

Animation: Marquee Effect

121 |

Example:

122 |

123 |

124 | <script>
125 | 	Title.animation("marquee");
126 | </script>
127 | 			
128 |

129 | Click To See On Title BarRefresh 130 |
131 | 132 |
133 |

Animation: TypeWriter Effect

134 |

Example:

135 |

136 |

137 | <script>
138 | 	Title.animation("typeWriter");
139 | </script>
140 | 			
141 |

142 | Click To See On Title BarRefresh 143 |
144 | 145 |
146 |
147 |

Social

148 | Fork @Github@TwitterFacebook 149 |
150 |
151 | 152 | 153 | -------------------------------------------------------------------------------- /title.js: -------------------------------------------------------------------------------- 1 | /********************** 2 | titleJs v1.0 | (c) 2014 | Author: Arkaprava Majumder | Author Uri: http://arkapravamajumder.com 3 | **********************/ 4 | var Title = { 5 | vars: { 6 | sourceTitle: document.title, 7 | counter: 0 8 | }, 9 | typeWriter: function(){ 10 | document.title=this.vars.sourceTitle.substring(0,this.vars.counter); 11 | if(this.vars.counter==this.vars.sourceTitle.length) 12 | { 13 | this.vars.counter=0; 14 | setTimeout("Title.typeWriter()",200); 15 | } else { 16 | this.vars.counter++; 17 | setTimeout("Title.typeWriter()",400); 18 | } 19 | }, 20 | marquee: function(){ 21 | document.title = this.vars.sourceTitle.substring(this.vars.counter, this.vars.sourceTitle.length)+" "+this.vars.sourceTitle.substring(0,this.vars.counter); 22 | this.vars.counter++; 23 | if (this.vars.counter > this.vars.sourceTitle.length) 24 | { 25 | this.vars.counter = 0; 26 | } 27 | setTimeout("Title.marquee()", 200); 28 | }, 29 | pref: function(param){ 30 | if(param.trim()!=""){ 31 | this.vars.sourceTitle=document.title=param+" "+this.vars.sourceTitle; 32 | } 33 | }, 34 | suf: function(param){ 35 | if(param.trim()!=""){ 36 | this.vars.sourceTitle=document.title=this.vars.sourceTitle+" "+param; 37 | } 38 | 39 | }, 40 | change: function(param){ 41 | if(param.trim()!=""){ 42 | this.vars.sourceTitle=document.title=param; 43 | } 44 | }, 45 | animation: function(param){ 46 | switch(param){ 47 | case "typeWriter": 48 | this.typeWriter(); 49 | break; 50 | case "marquee": 51 | this.marquee(); 52 | break; 53 | } 54 | } 55 | 56 | }; 57 | -------------------------------------------------------------------------------- /title.min.js: -------------------------------------------------------------------------------- 1 | /********************** 2 | titleJs v1.0 | (c) 2014 | Author: Arkaprava Majumder | Author Uri: http://arkapravamajumder.com 3 | Minified version 4 | **********************/ 5 | var Title={vars:{sourceTitle:document.title,counter:0},typeWriter:function(){document.title=this.vars.sourceTitle.substring(0,this.vars.counter);if(this.vars.counter==this.vars.sourceTitle.length){this.vars.counter=0;setTimeout("Title.typeWriter()",200)}else{this.vars.counter++;setTimeout("Title.typeWriter()",400)}},marquee:function(){document.title=this.vars.sourceTitle.substring(this.vars.counter,this.vars.sourceTitle.length)+" "+this.vars.sourceTitle.substring(0,this.vars.counter);this.vars.counter++;if(this.vars.counter>this.vars.sourceTitle.length){this.vars.counter=0}setTimeout("Title.marquee()",200)},pref:function(param){if(param.trim()!=""){this.vars.sourceTitle=document.title=param+" "+this.vars.sourceTitle}},suf:function(param){if(param.trim()!=""){this.vars.sourceTitle=document.title=this.vars.sourceTitle+" "+param}},change:function(param){if(param.trim()!=""){this.vars.sourceTitle=document.title=param}},animation:function(param){switch(param){case"typeWriter":this.typeWriter();break;case"marquee":this.marquee();break}}}; 6 | --------------------------------------------------------------------------------