Code solutions to PHP, JS, CSSCode source PHP, JS, CSS

Spread your code soluces to the world

Love me

JAVASCRIPT Source code

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...

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.

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.

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...

Rotate and scale with CSS

06/17/2011 by Dux   /   4.3/5 (32 ratings)
Here are two examples of rotation and scale (zoom) with CSS3. The first example uses javascript to apply transition effects by changing the CSS class of an element. This allows the event to be deported to another area. The second example works with the simplest pseudo-class HOVER. The effects do not work with Firefox for now only on...

Javascript Image magnification

06/16/2011 by Dux   /   4.5/5 (10 ratings)
Add magnifying glass options on your images with this simple code.

Infinite zoom CSS3 and Javascript

06/06/2011 by Dux   /   4.9/5 (7 ratings)
Here is an example of the use of CSS3 with scale. Update : Added compatibility with Opera 11

Page to top

06/08/2011 by Dux   /   4.4/5 (11 ratings)
ToTop() function associated with a link back to the top of page.

Link confirmation

06/06/2011 by Dux   /   5/5 (2 ratings)
This method adds a confirmation dialog on a href link.

Dynamic image resizing according to location

06/03/2011 by Dux   /   3.7/5 (3 ratings)
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

06/03/2011 by Dux   /   4.5/5 (13 ratings)
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 ...

Show hide DIV content with scrolling

05/18/2011 by Dux   /   3.8/5 (13 ratings)
Show and hide the contents of a DIV with a single function from a mouse event. The DIV unfolds and folds progressively through the setTimeout. To use this script, run the function deplie() on an event with argument ID of the DIV in question. You can set the DIV position to absolute not to move the below located content.

Div following the scrolling of the page

05/26/2011 by Dux   /   4.5/5 (17 ratings)
CSS fixed positioning does not work on Internet Explorer based browsers, it is therefore useful to use the javascript to fix vertically a DIV block. This function addresses the value of the div top CSS "fixedtop" taking into account the scrollTop of the page in the window. Tested on the most common browsers.

Scroll div with javascript

05/25/2011 by Dux   /   4.4/5 (48 ratings)
Very simple method to vertically scroll a DIV content without displaying scrollbars with Javascript. • The container div has overflow:hidden and a fixed height. • Its ID has to be recalled in the scrolldiv() function calls. This allows the multiple use of this function on the same page.

Dynamically add rows to a form. Complete solution

05/21/2011 by Dux   /   3.5/5 (22 ratings)
Here is a complete solution for adding rows to a form. This sample script displays a form for insert and update products. When clicking on the link [+], we add a new product line. It also includes the update by sending the "mod" parameter corresponding to the ID of the MySQL table row to edit. Dynamic system for adding rows : Initially, the...

Move dynamically a DOM objet up

05/13/2011 by Dux   /   4.3/5 (3 ratings)
When you display elements as list, it is sometimes necessary to provide the classification of the lines. This function can raise an object of a level. Eg. when displaying a list of products. The verification of the nodeType is used to circumvent a problem in some browsers that carriage returns and spaces between two objects as a "objet...

Dynamically resizing height of textarea

05/13/2011 by Dux   /   3.8/5 (19 ratings)
This code dynamically resize a textarea according to its contents. It can work when the textarea gains focus and during typing.