Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. var inside = 0;
  2. var check;
  3. $(document).ready(function(){
  4. $("body").prepend('<div id="popup" style="position:absolute; width:152px; background:#00bceb; z-index:10000; text-shadow: 1px 1px 0px #318cbb;"></div>');
  5. $(".page_item>a").mouseenter(function(){
  6. inside = 1;
  7. clearInterval(check);
  8. check = setInterval(function(){
  9. console.log(inside);
  10. if (!inside)
  11. $("#popup").slideUp();
  12. }, 1000);
  13. if (!$(this).next("ul").length)
  14. return false;
  15.  
  16. $(".menu>ul>.page_item>a").css({"borderBottom": "7px solid #9E9E9E"});
  17. $(this).css({"borderBottom": "7px solid #00BCEB"});
  18.  
  19. var offset = $(this).offset();
  20. if (!$("#popup").hasClass(offset.left.toString()))
  21. {
  22. var height = $(this).height();
  23. var width = $(this).width();
  24. var ul = $(this).next("ul");
  25. $("#popup").slideUp(function(){
  26. $("#popup") .empty()
  27. .removeClass()
  28. .addClass(offset.left.toString());
  29.  
  30. ul.clone().appendTo("#popup");
  31.  
  32. $("#popup .children li").css({"listStyle": "none","width":"150px", "background":"#00bceb","borderBottom": "1px solid #02a2ca", "borderTop":"1px solid #3cd5fb", "minHeight":"25px", "padding":"7px 0 2px 0"});
  33.  
  34.  
  35. $("#popup .children li a").css({"padding": "5px 1px 2px 5px", "textDecoration": "none", "color":"#fff" ,"fontFamily": "\"century gothic\", tahoma", "font-weight": "normal" });
  36. $("#popup .children li a").hover(function(){
  37. $(this).parent().css({"background":"#43c7e8","borderBottom": "1px solid #02a2ca"});
  38. }, function(){
  39. $(this).parent().css({"background":"#00bceb","borderBottom": "1px solid #02a2ca", "borderTop":"1px solid #3cd5fb"});
  40. });
  41.  
  42. $("#popup") .css({"top": offset.top+height+18,
  43. "left": offset.left,
  44. "width": width})
  45. .slideDown();
  46. });
  47. }
  48. });
  49. $(".page_item>a").mouseleave(function(){
  50. inside = 0;
  51. });
  52. $("#popup").mouseenter(function(){
  53. inside = 1;
  54. });
  55. $("#popup").mouseleave(function(){
  56. inside = 0;
  57. });
  58.  
  59.  
  60. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement