Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var inside = 0;
- var check;
- $(document).ready(function(){
- $("body").prepend('<div id="popup" style="position:absolute; width:152px; background:#00bceb; z-index:10000; text-shadow: 1px 1px 0px #318cbb;"></div>');
- $(".page_item>a").mouseenter(function(){
- inside = 1;
- clearInterval(check);
- check = setInterval(function(){
- console.log(inside);
- if (!inside)
- $("#popup").slideUp();
- }, 1000);
- if (!$(this).next("ul").length)
- return false;
- $(".menu>ul>.page_item>a").css({"borderBottom": "7px solid #9E9E9E"});
- $(this).css({"borderBottom": "7px solid #00BCEB"});
- var offset = $(this).offset();
- if (!$("#popup").hasClass(offset.left.toString()))
- {
- var height = $(this).height();
- var width = $(this).width();
- var ul = $(this).next("ul");
- $("#popup").slideUp(function(){
- $("#popup") .empty()
- .removeClass()
- .addClass(offset.left.toString());
- ul.clone().appendTo("#popup");
- $("#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"});
- $("#popup .children li a").css({"padding": "5px 1px 2px 5px", "textDecoration": "none", "color":"#fff" ,"fontFamily": "\"century gothic\", tahoma", "font-weight": "normal" });
- $("#popup .children li a").hover(function(){
- $(this).parent().css({"background":"#43c7e8","borderBottom": "1px solid #02a2ca"});
- }, function(){
- $(this).parent().css({"background":"#00bceb","borderBottom": "1px solid #02a2ca", "borderTop":"1px solid #3cd5fb"});
- });
- $("#popup") .css({"top": offset.top+height+18,
- "left": offset.left,
- "width": width})
- .slideDown();
- });
- }
- });
- $(".page_item>a").mouseleave(function(){
- inside = 0;
- });
- $("#popup").mouseenter(function(){
- inside = 1;
- });
- $("#popup").mouseleave(function(){
- inside = 0;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement