今日の人気記事

  1. Bootstrapを使ったカレンダーを実装「Zabuto Calendar」
  2. 水平・垂直スクロースのシングルページを実装「fullPage.js」

Web上で画像をトリミング(拡大・縮小)「cropimg」

当ページのリンクには広告が含まれています。

スポンサーリンク

Web上で画像をトリミング(拡大・縮小)することのできるプラグイン「cropimg」を紹介します。

jQueryプラグイン「cropimg」

このプラグインを使えば、Web上の画像をボックスの中で用意されたボタンで拡大・縮小することができます。

また、ボックス内で画像をマウス操作でドラッグし、移動することもできます。

スポンサーリンク

デモページで画像をトリミングしてみてください。

「cropimg」のデモ

ソース( HTML + jQuery )


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="cropimgのデモでーす。">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>cropimg - jQueryプラグイン</title>
<link href="css/cropimg.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-2.1.1.js"></script>
<script src="js/jquery.mousewheel.js"></script>
<script src="js/cropimg.jquery.js"></script>
</head>
<body>
<h1>cropimg デモでーす。</h1>
<img src="images/demo.png" alt="crop img" class="cropimg" />
<script>
$(document).ready(function() {
  $('img.cropimg').cropimg({
    resultWidth:400,
    resultHeight:300
  });
});
</script>
</body>
</html>
スポンサーリンク

関連記事(一部広告含む)