Advertisement
Guest User

Untitled

a guest
Oct 18th, 2013
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        миста
  3. // @namespace   http://www.forum.mista.ru
  4. // @include     http://www.forum.mista.ru/topic.php?id=*
  5. // @version     1
  6. // @grant       none
  7. // ==/UserScript==
  8.  
  9. $(document).ready(function() {
  10.    
  11.     // =================================================
  12.     // Окошко для показа сообщений
  13.     $('body').append("<div id='popupWin'></div>");
  14.     $('#popupWin').css({
  15.         'background-color': '#FFFFCC',
  16.         'border': '1px solid #CCCCCC',
  17.         'border-radius': '8px',
  18.         'font': '10pt Tahoma',
  19.         'padding':'10pt',
  20.         'left': '50%',
  21.         'position': 'fixed',
  22.         'top': '220px',
  23.         'z-index': '1000',
  24.         'display':'none',
  25.         'box-shadow': '0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6)'
  26.     });
  27.     // Закрытие по щелчку на блоке
  28.     $('#popupWin').live('click',function(){
  29.         $(this).fadeOut(200);
  30.     });
  31.     // примерно так получается текст
  32.     $('a.interlink').removeAttr('href');
  33.     $('a.interlink').css('cursor','pointer');
  34.     $('a.interlink').live('mouseover', function(e){
  35.         var msgid = $(this).data('rel');
  36.        
  37.         var offset = $(this).offset();
  38.         var relativeX = e.pageX - $(window).scrollLeft()+15;
  39.         var relativeY = e.pageY - $(window).scrollTop()+15;
  40.        
  41.         var msgtext = "<b>"+msgid+ "</b><br/>" + $(msgid).text();
  42.         $('#popupWin').css({'top':relativeY+'px','left':relativeX+'px'});
  43.         $('#popupWin').html(msgtext);
  44.         $('#popupWin').fadeIn(200);
  45.     }).live('mouseout', function(){
  46.         $('#popupWin').fadeOut(200);
  47.     });
  48.  
  49.    
  50. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement