背景画像として画像を指定しています。
ブラウザのサイズを変更すると、ブラウザのサイズに応じて背景画像がリサイズされます。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="ja" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<title>jQuery plugin: maxImage Image Scaler | 設置サンプル</title>
<link rel="stylesheet" type="text/css" href="/content/lib/global.css" />
<!-- JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="/content/lib/jquery/jquery.maximage.js"></script>
<script type="text/javascript">
$(function(){
$('img.maximage').maxImage({
verticalOffset: 91,
horizontalOffset: 520
});
$('img.bgmaximage').maxImage({
isBackground: true,
verticalAlign: 'top'
});
});
</script>
<style type="text/css">
html { overflow-x:hidden;overflow-y:scroll; }
body { color:#fff; }
.span-1 { width:300px; background:#000; float:left;margin-right:10px;opacity:.8;padding:10px; }
.liquid { margin:0 0 0 300px;position:relative;width:auto; }
</style>
<!--[if IE 6]>
<style>
body { height:100%; }
</style>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/common/css/example.css"></head>
<body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP & JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
<div id="wrap">
<img src="http://farm4.static.flickr.com/3113/3142386067_4a9dbc9844_o.jpg" width="640" height="480" alt="" class="bgmaximage" />
<h1><a href='http://aaronvanderzwan.com/blog/2009/02/jquery-plugin-maximage-image-scaler/'>jQuery plugin: maxImage Image Scaler</a> | 設置サンプル</h1>
<h2>Example1:背景画像のリサイズ</h2>
<p>背景画像として画像を指定しています。<br>ブラウザのサイズを変更すると、ブラウザのサイズに応じて背景画像がリサイズされます。</p>
<!-- CODE -->
<div class="cf">
<div class="span-1">
<h3>サンプル</h3>
<ul>
<li><strong>Example 1:<br><a href="example3.php?f=include/ajax/jquery_plugin_window/maximage.inc&ttl=jQuery+maxImage+plugin%82%CC%90%DD%92u%83T%83%93%83v%83%8B">画像のリサイズ</a></strong></li>
<li>Example 2:<br><a href="example3.php?f=include/ajax/jquery_plugin_window/maximage2.inc&ttl=jQuery+maxImage+plugin%82%CC%90%DD%92u%83T%83%93%83v%83%8B">ブラウザの端に画像を従わせる</a></li>
<li>Example 3:<br><a href="example3.php?f=include/ajax/jquery_plugin_window/maximage3.inc&ttl=jQuery+maxImage+plugin%82%CC%90%DD%92u%83T%83%93%83v%83%8B">画像を原寸大より大きくしない</a></li>
<li>Example 4:<br><a href="example3.php?f=include/ajax/jquery_plugin_window/maximage4.inc&ttl=jQuery+maxImage+plugin%82%CC%90%DD%92u%83T%83%93%83v%83%8B">背景画像をスライドショー(リサイズ対応)</a></li>
<li>Example 5:<br><a href="example3.php?f=include/ajax/jquery_plugin_window/maximage5.inc&ttl=jQuery+maxImage+plugin%82%CC%90%DD%92u%83T%83%93%83v%83%8B">テーブル使用(非推奨)</a></li>
</ul>
</div>
</div>
</div>
<!-- / CODE -->
</body>
</html>