[Fancy Letterライブラリ] 段落の最初の英文字を大きくする

説明

Fancy Letterライブラリで段落の最初の英文字を大きくするには対象のエレメント(タグ)を$()のパラメータに指定しfancyletter()メソッドを呼び出します。なお、日本語などには対応していないため英文字のみ処理されます。

サンプルプログラム

【HTML】
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="css/fancyletter.css" type="text/css" media="all">
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.fancyletter.js"></script>
<script type="text/javascript" src="js/sample.js"></script>
</head>
<body>
<h1>Fancy Letterサンプル</h1>
<p>A 段落の最初の英文字を大きくしたり枠で囲むことができます。</p>
<p>B 複数の段落にも対応しています。</p>
</body>
</html>

【sample.js】
$(function(){
$("p").fancyletter();
});
サンプルを実行
[戻る]