Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (25 sloc) 1.16 KB
Demo and unit testing: tests/photo_tags/index.html
1. Reference css and javascript files:
<script src="../../libraries/jquery.dev.1.7.1.js" type="text/javascript"></script>
<script src="../../libraries/jquery-ui-1.8.17.custom.min.js" type="text/javascript"></script>
<script src="../../js/jquery.phototag.js" type="text/javascript"></script>
<link rel="stylesheet" href="../../libraries/jquery-ui-1.8.17.custom.css" type="text/css" media="screen" />
<link rel="stylesheet" href="styles2.css" type="text/css" media="screen" />
2. Call the photo tag plguin on load:
$(document).ready(function(){
$('.photoTag').photoTag({
requesTagstUrl: '/static/photo-tag/tests/photo_tags/photo-tags.php',
deleteTagsUrl: '/static/photo-tag/tests/photo_tags/delete.php',
addTagUrl: '/static/photo-tag/tests/photo_tags/add-tag.php',
parametersForNewTag: {
name: {
parameterKey: 'name',
isAutocomplete: true,
autocompleteUrl: '/static/photo-tag/tests/photo_tags/names.php',
label: 'Name'
}
}
});
});
3. Add the image
<img src="http://karlmendes.com/static/photo-tag/tests/photo_tags/monkeys2.jpg" class="photoTag" data-user-id="25" data-image-id="200" data-album-id="200">