Snippets for Website Development

Javascript Snippets

Change a Page's Stylesheet Using Javascript Javascript If-Else Shortcut Ternary Operator Swap Variables in One Line of Code Javascript array_unique (similar to PHP) Sort a Javascript 2d Array by Any Column Value Sort an HTML Table by Column Using Javascript Variable Name Functions Accordion Menu Replace All function using Javascript Occurrences of Substring in String Detect Javascript Swipe for Touch Screens and Mouse Get Hypotenuse Using Pythagorean Create an Image Zoom Window with Javascript Get String Between Strings with JavascriptImmediately Invoke a Javascript Function Round Numbers Accurately to Specified Place Value with Javascript Check if String Contains Substring Pass Javascript Variables to Another Page Split a String Into a 2-Dimensional-Array Strip HTML Tags from String Remove Quotes from String Remove Return Characters From String Determine if a Javascript Variable is a Number Copy text from an input box to the clipboard Fade an Element In or Out with a Toggle Javascript Equivalent to file_get_contents("filename.html") Random Shuffle Javascript Array Determine When HTML Element Comes Into Viewport While Scrolling Conditionally Load a Javascript File Javascript Send Form With No Target Check for Mobile Phone Get the Date String in Milliseconds Javascript Equivalent to array_unique() Javascript Equivalent to the PHP natsort($array) Watch or Monitor Javascript Variables for Change Javascript Equivalent to the PHP array_values function Find if Item Exists in 2-Dimentional Javascript Array

CSS Snippets

Vertically Center Align Text Right of an Image Change the Text Color of the Form Input Placeholder Style First Letter of a Sentence Pure CSS Hamburger Menu Icon Sticky Footer When Content Is Not Full Screen CSS Button Pure CSS Onclick Dropdown Menu Horizontal Rule with Gradient Fade Out of Ends Fade-in a Page or Element on Page Load Tab Menu Using CSS Only Dynamically Resize a DIV or Other HTML Element Timer Shown by Progress Bar Make Columns Break at New Paragraph - Not Within a Paragraph Adjust Image Responsive to Screen Size Center Image Vertically and Horizontally Pulse An HTML Element Using CSS Alternate Shading on a Table Row

PHP Snippets

Swap Variables in One Line Using PHP Load CSV Into a 2-d Array Using PHP Convert a PHP 2d-Array to CSV Load CSV File Into PHP 1-d Array Insert an Element into a PHP Array Remove the Last Character From a PHP String Round a PHP 2d Array by a Specified Key Determine if PHP String Contains a Substring Get Contents of Directory in PHP Calculate Script Execution Time Loop for a Period of Time Loop Structures in PHP Use PHP to Get the Links from an HTML Page Get the Distance Between Two Points in Latitude and Longitude Basic Template for New PHP File Get String Between Strings

HTML Snippets

HTML Input Type for Native Search HTML Color Picker HTML Include File (SSI or Client) Pure HTML Dropdown Details Summary Tag HTML Q Tag Provides an Easy Quote HTML Mark Tag for Easy Highlighting Form With Label Image With Overlapping Caption Dynamically Load Content Without AJAX Data Image Used as a Placeholder for Spacing Get Map Directions on Google Maps Basic HTML Template Open Two Pages With One Link Open URL Using Button in Same or New Window Indent HTML text Multiple Levels
Copyright © Website Development | Disclaimer | Privacy Policy | Terms of Use