/**
* Image Filter Javascript Function
*
* @package PHP Image Filter GD
* @version 1.0.1
* @author MT Jordan <mtjo62@gmail.com>
* @copyright 2014
* @license zlib/libpng
*/
var url = 'http://mysite.com/path/to/image_filter.php';
if ( !window.addEventListener )
{
window.attachEvent( 'load', filter_images( url ) );
}
else
{
window.addEventListener( 'load', filter_images( url ), false );
}
function filter_images( url )
{
var filter = document.getElementsByClassName( 'filter_gd' );
var filter_URL = url;
for ( var i = 0; i < filter.length; i++ )
{
var effect = filter[i].getAttribute( 'alt' );
var img = filter[i].getAttribute( 'src' );
filter[i].setAttribute( 'src', filter_URL + '?filename_gd=' + img + '&filter_gd=' + effect );
}
}
/* EOF image_filter.js */
/* Location: ./image_filter.js */
|