Сообщение от ksa
|
Как вариант...
|
Как вариант [2]...
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style type="text/css">
p { clear: both }
.sizeable { display: block; float: left; cursor: pointer; padding: 6px }
.fullscr { position: absolute; top: 0; left: 0; cursor: pointer }
.fullscr > img { width: 100%; height: 100% }
</style>
<script type="text/javascript">
$(document).ready(function () {
$('div img').click(function () {
var o = $(this).parent();
var url = o.find('img').attr('src');
var oftop = window.scrollY;
var html = '<div class="fullscr" style="top: '+oftop+'px"><img src="'+url+'" /></div>'
o.append(html);
o = o.find('.fullscr');
o.animate({width:'100%',height:'100%'});
o.click(function () {
$(this).remove();
});
});
$(window).scroll(function() {
$('div.fullscr').remove();
});
});
</script>
</head>
<body>
<p>some text
<div class="sizeable"><img src='http://javascript.ru/forum/images/ca_serenity/misc/logo.gif' /></div>
<div class="sizeable"><img src='http://javascript.ru/forum/images/ca_serenity/misc/logoNY.jpg' /></div>
<p>more text
</body>
</html>