Code solutions to PHP, JS, CSS

Spread your code soluces to the world

Love me

Search results for : image    (10)

Javascript Image magnification (javascript)

Add magnifying glass options on your images with this simple code.

Isolate a color (php gd image)

Here is a class to isolate a primary color rendering of a photo black and white. The choice of using Object-oriented programming instead of a function gives the advantage to add filters or other image effects thereafter. Instantiation [code]$obj = new image_effect(); // Optional : ratio size of the working image. default : 2 ...

Extract images from a page (php)

Getting all IMG sources and ALT from a local or remote page that returns an array. This function uses the DOM API from PHP 5. get_i( file ) = array( att, value )

Horizontal scroll div with javascript (javascript)

Very simple method to horizontally scroll a DIV content without displaying scrollbars with Javascript. • The container div has overflow:hidden and a fixed height and width. • Its ID has to be recalled in the scrolldiv() function calls. This allows the multiple use of this function on the same page.

Dynamic image resizing according to location (javascript)

This javascript method resize image according to its location in the page. Images do not overflow the page or div that contains them. It works automatically, it is not necessary to modify the HTML content of the body. Implementation : • copy the javascript code in the header, between <head> and </head> • In the body...

Javascript opacity (javascript)

Here is the method the most compatible to change the CSS opacity of an element with javascript. [code]opacity // modern browser -moz-opacity // older versions based on firefox -khtml-opacity // older versions based on Konkeror and Safari filter: alpha(opacity) // Internet Explorer before 8.0 ...

Adjust the rate of image colors (php gd image)

This script adjusts the amount of colors in a jpg, gif or png picture. By modifying the value $variant between -25 and 15, you get a picture more or less colorful. Original picture

Zoom with CSS3 (css)

CSS3 allows the function of "scaling"(or zoom) on an HTML element. In the example below, the scale is assigned to the pseudo class : hover. Syntax : transition: (transition-property) (transition-duration in secondes) (transition-timing-function) • transition-property : all, css property • transition-duration : timing...

Simple image gallery PHP (php)

The following code is an image gallery script in PHP as easy as possible. A single file of a few lines of code is sufficient to list the images, create thumbnails and display them. Copy the entire code into a PHP file. Name it as you wish and drop it in a directory containing images. For reasons of simplicity, this code has no error handling....

Automatically adjust brightness contrast of an image (php gd image)

This script adjusts the brightness and contrast of an image using PHP5 and the GD2 library. Set the variable $url_img with the path of your initial image. You can change the variable  which corresponds to the size of the working image of the script.