Skip to content
Harsh Raval edited this page Feb 12, 2014 · 2 revisions

Setup

All examples below use the following code as their setup.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Img Live</title>
<link href="premage/src/css/premage.css" rel="stylesheet" />
<link href="jquery-ui.min.css" rel="stylesheet" />
<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js" type="text/javascript" ></script>
<script type="text/javascript" src="premage/src/js/premage.js"></script>
</head>
<body>
<input type="file" name="imglive" id="imglive" />
</body>
</html>

Simplest example

/* Here imgLive is the id of input having type=file. */
$("#imglive").livePreview();

Round image preview

/* Here imgLive is the id of input having type=file. */
$("#imglive").premage({
	shape: {
		type:'round'
	},
	image_container:{ 
		shape: {
			type:'round'
		}
	}
});

Round image preview with animation

Round image preview with slide up and down effect while changing the image.

/* Here imgLive is the id of input having type=file. */
$("#imglive").premage({
	shape: {
		type:'round'
	},
	image_container:{ 
		shape: {
			type:'round'
		}
	},
	animation: {
		enabled: true
	}
});
Clone this wiki locally