Показать сообщение отдельно
  #2 (permalink)  
Старый 14.06.2010, 05:54
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,068

var content = '<div style="position: relative; background: #555; width: ' + sets.w + 'px; height: ' + sets.h + 'px ">' ---а сам код рабочий
можно ещё самоудаление добавить по клику если оно конечно надо)))
<script language="JavaScript" src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
function jWnd(sets) {
   var header = sets.header ? '<div style="position: relative; background: #555; border-bottom: 3px solid orange; width: ' + sets.w + 'px; height: 20px;">' + sets.header + '</div>': '';
   var content = '<div style="position: relative; background: #555; width: ' + sets.w + 'px; height: ' + sets.h + 'px">' + sets.content + '</div>';
   var x = $('<div style="position: fixed; opacity: 0">' + header + content + '</div>');
	x.appendTo($('body')).css({
		top: ($(document).height() - $(x).height()) / 2,
		left: ($(document).width() - $(x).width()) / 2
	}).animate({
		opacity: 1
	},
	1000).click(function () {
      $(this).remove()} )
};
/*]]>*/
</script>
<a href="#" onclick='jWnd({"header":"Заголовок","content":"Содержание","w":200,"h":50})'>пуск</a>

Последний раз редактировалось рони, 14.06.2010 в 07:46.
Ответить с цитированием