Code solutions to PHP, JS, CSS

Spread your code soluces to the world

Love me
Solucior easy source codes

Last soluces

javascript css - Very simple drag and drop upload form

10/08/2015 by Dux   /   3/5 (1 ratings)
There are many solutions and scripts for drag and drop upload. Here is a very simple solution using the native drag and drop of the modern browsers type file input. It is also compatible with browsers that do not support drag and drop as smartphone because it uses conventional HTML forms input. Tested with Safari, Chrome, Firefox last...

javascript - Load image with page scroll.Lazy loading

10/02/2014 by Dux   /   not rated
Images are displayed only when they are in the visible area of the window (lazy loading). The code work with the page scrolling. You dont need to modify your HTML code. You can replace the favicon.gif by a blank gif/png.

php - Display natural human dates for past dates

09/17/2014 by Dux   /   not rated
Little function to display past dates with a natural human language as on iphone based messages. It can write dates : now, 5mn ago, today at 12:18, yesterday at 08:20, monday at 21:12, 3 november at 12:18 (modify function for english users), 24 december 2013 at 23:59

css - Zoom with CSS3

05/25/2011 by Dux   /   4.6/5 (135 ratings)
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...

php gd image - Image class resize and rounded mask

02/02/2012 by Dux   /   5/5 (1 ratings)
This PHP GD class offers several useful features. It resizes images, apply a rounded mask with various options : • output size • crop mode : crop to fill, fill to fit • rounded corners or square • color of the rounded mask It is complete and usable in all cases. This class use the PNG mask round_440.png

htaccess - Automatic search result page

01/27/2012 by Dux   /   5/5 (1 ratings)
Here is a simple method using htaccess to turn an URL to a search results page. Htaccess code obviously not include the search engine. It only transmits the variable q to be treated by your internal search engine. Elegant and efficient solution to capture a indexing bot a on keyword page. If your data is in MySQL...

php gd image - PHP watermark

01/13/2012 by Dux   /   5/5 (3 ratings)
This script applies a watermark on a JPG, GIF or PNG image. The watermark comes from a 24-bit PNG that preserve empty areas around the logo. I recommend Photoshop to make it. This is the only script that changes the opacity of an image before pasting to another. For indeed, PHP5 and GD2 library does not own filter opacity. Operation is simple....

css - Centering an element in the page

09/15/2011 by Dux   /   4/5 (1 ratings)
Here are two methods to center CSS DIV blocks inside the page or parent element. The first method uses absolute positioning wich does not consider the position of other page elements. It is recommended for a rapid implementation of a correctly set graphical template. The second method uses a div to wedge the second DIV in height. The horizontal...

javascript - Horizontal scroll div with javascript

09/12/2011 by Dux   /   4.1/5 (44 ratings)
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.

javascript - Sound effects on an action with HTML5

09/09/2011 by Dux   /   4.9/5 (8 ratings)
HTML5 has simplified the handling of multimedia files. The simple tag audio replaces the couple object embed with param. A single line of code is sufficient and it is controllable with javascript. In the example below the onmouseout is used to refresh the source of the audio file. In addition to the preload attribute, you can use in the same...