/*! * jQuery Sander popup windows * http://nfhelp.ru/ * Copyright 2010, Sander */ $(document).ready(function(){ var yOffset=20; var wwidth=(window.innerWidth)?window.innerWidth:((document.all)?document.documentElement.offsetWidth:null); var wheight=(window.innerHeight)?window.innerHeight:((document.all)?document.documentElement.offsetHeight:null); $(".stip").unbind().live('mouseover',function(e){ var t=$(this).attr('spopup'); $('div#stip').remove(); var width=$("div#stip").width(); var height=$("div#stip").height(); var wscroll=(document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop; $('body').append('
'+t+'
'); if(wheight+wscroll-30>e.pageY+height){ this.top=(e.pageY+yOffset); xOffset=20; }else{ this.top=(wheight-height+wscroll-yOffset); xOffset=40; } if(e.pageX>(wwidth/2)) this.left=(e.pageX-width-xOffset) else this.left=(e.pageX+xOffset) $('div#stip').css("top",this.top+"px").css("left",this.left+"px").fadeIn(700); }).live('mouseout',function(){ $("div#stip").fadeOut(200) }).mousemove(function(e){ var width=$("div#stip").width(); var height=$("div#stip").height(); var wscroll=(document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop; if(wheight+wscroll-30>e.pageY+height){ this.top=(e.pageY+yOffset); xOffset=20; }else{ this.top=(wheight-height+wscroll-yOffset); xOffset=40; } if(e.pageX>(wwidth/2)) this.left=(e.pageX-width-xOffset) else this.left=(e.pageX+xOffset) $("div#stip").css("top",this.top+"px").css("left",this.left+"px") }); }); function s_page(title, page, category){ $("div#sblocks_"+title+" table").animate({opacity: 0.01}, 500, function(){}); $.post(dle_root + "engine/ajax/sblocks.php", { title: title, sstart: page, skin: dle_skin, category: category }, function(data){ HideLoading(''); $("#sblocks_"+title).html(data); }); return false; };