Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var quotes: {
- element: null,
- counter: 0,
- index: 0,
- array: [
- "cool",
- "moderno",
- "prático",
- "inovador",
- "interessante",
- "smart",
- "Mad Bird",
- "econômico",
- "inteligente"
- ],
- initialize: function(){
- quotes.element = $(".rotatingQuotes").find("#elogio");
- $(window).scroll(quotes.update());
- quotes.update();
- },
- update: function() {
- if (quotes.counter >= 10) {
- quotes.rotate();
- quotes.counter = 0;
- } else {
- quotes.counter++;
- }
- },
- rotate: function() {
- if (quotes.index == quotes.array.length) {
- quotes.index = 0;
- }
- var quote = quotes.array[quotes.index];
- quotes.element.fadeOut(0, function() {
- $(this).text(quote).fadeIn(100);
- });
- quotes.index++;
- }
- };
- $(document).ready(function() {
- quotes.initialize();
- });
- /*
- <div class="rotatingQuotes">
- <div class="text">
- Ser <span id="resp-cor">responsivo</span> é ser <span id="elogio" style=""></span>
- </div>
- </div>
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement