PHP Classes

File: image_filter.js

Recommend this page to a friend!
  Classes of Mike Jordan   PHP Image Filter GD   image_filter.js   Download  
File: image_filter.js
Role: Auxiliary data
Content type: text/plain
Description: Demo Javascript file that handles DOM functions
Class: PHP Image Filter GD
Apply image effect filters to remote images
Author: By
Last change: Updated header docs
Date: 10 years ago
Size: 892 bytes
 

Contents

Class file image Download
/** * 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 */