Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.1 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<title>CSS - Float test</title>
<script src="../lib/prototype.js" type="text/javascript"></script>
<script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
<script src="../cropper.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
// setup the callback function
function onEndCrop( coords, dimensions ) {
$PR( 'x1' ).value = coords.x1;
$PR( 'y1' ).value = coords.y1;
$PR( 'x2' ).value = coords.x2;
$PR( 'y2' ).value = coords.y2;
$PR( 'width' ).value = dimensions.width;
$PR( 'height' ).value = dimensions.height;
// float example
function() {
new Cropper.Img(
onEndCrop: function( coords, dimensions ) {
$PR( 'floatX1' ).value = coords.x1;
$PR( 'floatY1' ).value = coords.y1;
$PR( 'floatX2' ).value = coords.x2;
$PR( 'floatY2' ).value = coords.y2;
$PR( 'floatWidth' ).value = dimensions.width;
$PR( 'floatHeight' ).value = dimensions.height;
if( typeof(dump) != 'function' ) {
Debug.init(true, '/');
function dump( msg ) {
Debug.raise( msg );
} else dump( '---------------------------------------\n' );
<link rel="stylesheet" type="text/css" href="debug.css" media="all" />
<style type="text/css">
label {
clear: left;
margin-left: 50px;
float: left;
width: 5em;
html, body {
margin: 0;
#testWrap {
margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */
#test-float {
width: 600px;
float: right;
background-color: #eee;
border: 3px solid #000;
margin: 10px;
padding: 5px;
<h2>Test page with floating wrapper</h2>
Some test content before the image
<div id="test-float">
<h2>Float test</h2>
<div id="testFloatWrap">
<img src="castle.jpg" alt="test image" id="testFloatImage" width="500" height="333" />
<label for="floatX1">x1:</label>
<input type="text" name="floatX1" id="floatX1" />
<label for="floatY1">y1:</label>
<input type="text" name="floatY1" id="floatY1" />
<label for="floatX2">x2:</label>
<input type="text" name="floatX2" id="floatX2" />
<label for="floatY2">y2:</label>
<input type="text" name="floatY2" id="floatY2" />
<label for="floatWidth">width:</label>
<input type="text" name="floatWidth" id="floatWidth" />
<label for="floatHeight">height</label>
<input type="text" name="floatHeight" id="floatHeight" />