Показать сообщение отдельно
  #10 (permalink)  
Старый 14.11.2013, 14:01
Аспирант
Отправить личное сообщение для CrazyBite Посмотреть профиль Найти все сообщения от CrazyBite
 
Регистрация: 18.07.2013
Сообщений: 43

Сообщение от ksa Посмотреть сообщение
Делай полный тестовый пример - там посмотрим что у тебя и как...
Index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="ru" dir="ltr">
<head>
	<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
	<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
	<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
	<script src='jquery.modal_box_ik.js'></script>
	<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
</head>
<body>
	<span class="name_text" id ='555'>click me</span>
<script>
	$(document).ready(function(){
		var row_val="none";
		var id_val=0;
		$(".name_text").click(function(data){
			row_val = data.target.className;
			id_val = data.target.id;
			$(".name_text").paulund_modal_box({"id":id_val,"row":row_val});
		});
		$(".name_text").paulund_modal_box({"id":id_val,"row":row_val});	
	});
	</script>
</body>
</html>

jquery.modal_box_ik.js
(function($){
	$.fn.paulund_modal_box = function(prop){

		var options = $.extend({
			height : "250",
			width : "500",
			top: "4%",
			left: "4%",
			id:0,
			row:"norow"
		},prop);
		
		return this.click(function(e){
			add_block_page();
			add_popup_box();
			add_styles();
			
			$('.paulund_modal_box').fadeIn();
		});
		
		function add_styles(){			
			$('.paulund_modal_box').css({ 
				'position':'absolute', 
				'left':options.left,
				'top':options.top,
				'display':'none',
				'height': options.height + 'px',
				'width': options.width + 'px',
				'border':'1px solid #fff',
				'box-shadow': '0px 2px 7px #292929',
				'-moz-box-shadow': '0px 2px 7px #292929',
				'-webkit-box-shadow': '0px 2px 7px #292929',
				'border-radius':'10px',
				'-moz-border-radius':'10px',
				'-webkit-border-radius':'10px',
				'background': '#f2f2f2', 
				'z-index':'50',
			});
			$('.paulund_modal_close').css({
				'position':'relative',
				'top':'-25px',
				'left':'20px',
				'float':'right',
				'display':'block',
				'height':'50px',
				'width':'50px',
				'background': 'url(../img/close.png) no-repeat',
			});
			$('.paulund_block_page').css({
				'position':'absolute',
				'top':'0',
				'left':'0',
				'background-color':'rgba(0,0,0,0.6)',
				'height':'100%',
				'width':'100%',
				'z-index':'10'
			});
			$('.paulund_inner_modal_box').css({
				'background-color':'#fff',
				'height':(options.height - 50) + 'px',
				'width':(options.width - 50) + 'px',
				'padding':'10px',
				'margin':'15px',
				'border-radius':'10px',
				'-moz-border-radius':'10px',
				'-webkit-border-radius':'10px'
			});
		}
		
		 function add_block_page(){
			var block_page = $('<div class="paulund_block_page"></div>');
			$(block_page).appendTo('body');
		}
		 			  
		 function add_popup_box(){			
			var text = "some error, sorry";
			console.log("row: "+options.row+" id: "+options.id);
			var pop_up = $('<div class="paulund_modal_box"><a href="#" class="paulund_modal_close"></a><div class="paulund_inner_modal_box">'+text+'</p></div></div>');

			 
			$(pop_up).appendTo('.paulund_block_page');
			 			 
			$('.paulund_modal_close').click(function(){
				if (confirm("Закрыть?")){
					$(this).parent().fadeOut().remove();
					$('.paulund_block_page').fadeOut().remove();				 
				}
			});
			$('.my_modal_close').click(function(){
				if (confirm("Закрыть?")){
					$(this).parent().fadeOut().remove();
					$('.paulund_block_page').fadeOut().remove();				 
				}
			});
		}
		return this;
	};	
})(jQuery);
Ответить с цитированием