Advertisement
Guest User

Mangalator Mouse Pop-up Script by Suwako

a guest
Jun 25th, 2015
1,421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Mangalator Mouse Pop-up
  3. // @author  Suwako
  4. // @description Makes the second translation box pop-up near the mouse instead
  5. // @include     http://mangalator.ch/show.php*
  6. // @require     http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
  7. // @version     1.0
  8. // ==/UserScript==
  9. //-----------------------------------------------------------
  10. this.$ = this.jQuery = jQuery.noConflict(true); // Avoid duplicate jQuery conflict
  11. //-----------------------------------------------------------
  12. $(function() {
  13. //-----------------------------------------------------------
  14. var mouseX; var mouseY;
  15. $(document).mousemove(function(e) {
  16.     mouseX = e.pageX - 80;
  17.     mouseY = e.pageY + 80; });
  18.  
  19. $('.secondTranslationBox').hide();
  20. $('.secondTranslationBox').css({'z-index':500});
  21.  
  22. $('.window').mouseover(function() {
  23.     $('.secondTranslationBox').css({'top':mouseY,'left':mouseX}).fadeIn('fast'); });
  24.  
  25. $('.window').mouseout(function() {
  26.     $('.secondTranslationBox').fadeOut('fast'); });
  27. //-----------------------------------------------------------
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement