Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example showing multiple select #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions demos/demo_files/multiple.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.target_multi {
width: 400px;
height: 300px;
}

.target_multi .target, .target_multi img {
width: 400px;
height: 300px;
position: absolute;
}
.jcrop-holder {
width: 400px !important;
height: 300px !important;
background: none !important;
position: absolute !important;
}
90 changes: 90 additions & 0 deletions demos/multiple.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello World | Jcrop Demo</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />

<script src="../js/jquery.min.js"></script>
<script src="../js/jquery.Jcrop.js"></script>
<script type="text/javascript">
jQuery(function($){

var options = {
bgColor: 'black',
bgOpacity: 0.8,
setSelect: [20, 20, 300, 200]
}

//wrap in timeout or doesn't always load
window.setTimeout( function(){

$('#target_1').Jcrop(
$.extend({aspectRatio: 16/9}, options)
);

$('#target_2').Jcrop(
$.extend({aspectRatio: 4/3}, options)
);

$('#target_3').Jcrop(
$.extend({aspectRatio: 9/16}, options)
);
}, 0);

});

</script>
<link rel="stylesheet" href="demo_files/main.css" type="text/css" />
<link rel="stylesheet" href="demo_files/demos.css" type="text/css" />
<link rel="stylesheet" href="demo_files/multiple.css" type="text/css" />
<link rel="stylesheet" href="../css/jquery.Jcrop.css" type="text/css" />

</head>
<body>

<div class="container">
<div class="row">
<div class="span12">
<div class="jc-demo-box">

<div class="page-header">
<ul class="breadcrumb first">
<li><a href="../index.html">Jcrop</a> <span class="divider">/</span></li>
<li><a href="../index.html">Demos</a> <span class="divider">/</span></li>
<li class="active">Hello World</li>
</ul>
<h1>Hello World</h1>
</div>

<div class="target_multi">
<div class="target" id="target_1"> </div>
<div class="target" id="target_2"> </div>
<div class="target" id="target_3"> </div>
<img src="demo_files/sago.jpg" alt="[Jcrop Example]" />
</div>

<div class="description">
<p>
<b>This example demonstrates mulitple selection in Jcrop.</b><br />
Since no event handlers have been attached it only performs
the cropping behavior.
</p>
</div>

<div class="tapmodo-footer">
<a href="http://tapmodo.com" class="tapmodo-logo segment">tapmodo.com</a>
<div class="segment"><b>&copy; 2008-2014 Tapmodo Interactive LLC</b><br />
Jcrop is free software released under <a href="../MIT-LICENSE.txt">MIT License</a>
</div>
</div>

<div class="clearfix"></div>

</div>
</div>
</div>
</div>

</body>
</html>

2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ <h3>Static Demos</h3>
&mdash; animation/fading demo</li>
<li><a href="demos/tutorial5.html">API Interface</a>
&mdash; real-time API example</li>
<li><a href="demos/multiple.html">Multiple Selection</a>
&mdash; multiple selection example</li>
<li><a href="demos/styling.html">Styling Example</a>
&mdash; style Jcrop dynamically with CSS
<small>New in 0.9.10</small>
Expand Down