Javascript-форум (https://javascript.ru/forum/)
-   jQuery (https://javascript.ru/forum/jquery/)
-   -   помогите с JQuery popup (https://javascript.ru/forum/jquery/29342-pomogite-s-jquery-popup.html)

Deff 24.06.2012 22:09

<script>	
	jQuery(document).ready(function ($){

	$.allshow = function(){
		$("#home").show();
		$("#biosepticjs").show();
		$("#waterpolejs").show();
		$(".biosepticlight").fadeIn(500);
		$(".waterpolelight").fadeIn(500);
		return;
		};
	$.fastshow = function(){
		$("#home").show();
		$("#biosepticjs").show();
		$("#waterpolejs").show();
		$("#biosepticjs .biosepticlight").show();
		$("#waterpolejs .waterpolelight").show();
		return;
		};
	$.allhide = function(){
		$(".biosepticlight").fadeOut(100);
		$(".waterpolelight").fadeOut(100);
		return;
		};

	$.thehide = function(){
		$("#home > div").hide();
		$("#biosepticjs").show();
		$("#waterpolejs").show();
		return;
		};


	$("#home").hide();
	$.thehide();
	$("#home").fadeIn("slow");

	
	$("#home").mouseenter($.allshow).mouseleave($.allhide);
	
	$("#biosepticjs").mouseenter(function(){
		$(".biosepticlight").hide();
		$("#waterpolejs").hide();
		$("#popup > h1").text("Биосептик");
		$(".biosepticover").fadeIn(200);
		$("#popup").fadeIn(200);
		});


		var clickFlag = false;
	$(".biosepticover").mouseout(function(){
		if(!clickFlag){$("#popup").hide()}
		$.fastshow();
		$(".biosepticover").hide();
		$(".biosepticlight").fadeIn(100);});

	$(".biosepticover").mousemove(function(e){
		var parentOffset = $(this).parent().offset(); 
		var relX = e.pageX - parentOffset.left+15;
		var relY = e.pageY - parentOffset.top+15;
		$("#popup").css({"top" : relY, "left": relX});
		});


	$(".biosepticover").click(function(){
		clickFlag = true;
		$(this).hide();
		$("#popup").animate({top:0, left:0, width:"575px", height:"528px"});
		$("#popup").css({backgroundColor: "#fff", color: "#444",zIndex: 1}); 
		$("#popclose").show();
		
		});


	$("#popclose").click(function(){
		$("#popup").hide();
		$(this).hide();
		$("#popup").css({zIndex: 0});
 		$("#popup").css({width: 190, height: 90,backgroundColor: "rgba(0,0,0,0.6)", color: "#fff"});
		clickFlag = false;
		});

});</script>

Deff 24.06.2012 23:04

Поправил
ЫЫ Еще раз

Art!P 24.06.2012 23:26

http://jsfiddle.net/M59bp/2/
оно оно :D
урааа!!! Работает как надо! Deff дайте я вашу жопу расцелую!!!!
думал про шаманство с булом, но не понимал как сделать!
Спасибо! В репу получите!


Часовой пояс GMT +3, время: 00:01.