Advertisement
Guest User

iinfo carousel

a guest
Apr 26th, 2014
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Carousel
  3. // @namespace   iinfo
  4. // @include     *root.cz*
  5. // @version     1
  6. // @grant       none
  7. // @require     http://code.jquery.com/jquery-2.1.0.min.js
  8. // ==/UserScript==
  9.  
  10. (function() {
  11.    
  12.     /**
  13.      * Add styles to head
  14.      *
  15.      * @param {String|Array} rules CSS rules
  16.      */
  17.     function css(rules) {
  18.         rules = rules instanceof Array ? rules.join('\n') : rules;
  19.         var head = document.head || document.getElementsByTagName('head')[0];
  20.         var style = document.createElement('style');
  21.         style.type = 'text/css';
  22.         if (style.styleSheet)
  23.             style.styleSheet.cssText = rules;
  24.         else
  25.             style.appendChild(document.createTextNode(rules));
  26.         head.appendChild(style);
  27.     }
  28.  
  29.     // Add styles
  30.     css([
  31.         '.hidden {',
  32.         '    -webkit-transition: opacity 0.3s;',
  33.         '    -moz-transition: opacity 0.3s;',
  34.         '    -ms-transition: opacity 0.3s;',
  35.         '    transition: opacity 0.3s;',
  36.         '    opacity: 0.05;',
  37.         '}',
  38.         '.hidden:hover {',
  39.         '    opacity: 1;',
  40.         '}'
  41.     ]);
  42.  
  43.     // Mark unwanted elements
  44.     $(function() {
  45.  
  46.         // PR articles
  47.         $('.article').each(function() {
  48.             if ($('.admarker', this).length)
  49.                 $(this).addClass('hidden');
  50.         });
  51.  
  52.         // Carousel
  53.         $('#promo-footerPromo').addClass('hidden');
  54.     });
  55. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement