I AM LISTENING TO
|
HOME
BOOK ME
SERVICES
PORTFOLIO
PODCAST
CONTACT
DATA PRIVACY
WHAT I LIKE
HOME
BOOK ME
SERVICES
PORTFOLIO
PODCAST
CONTACT
DATA PRIVACY
AGB
BLOG FILTER
ALL
Changelog
Consulting
Design
SVG
Solutions
Development
HTML5
Hosting
Realbasic
PHP
Javascript
WordPress
Magento
Mobile
API
Adwords
Analytics
Essentials
Bootstrap
CSS
LMS
IoT
Home Automation
Deployment
WebRTC
Security
Ruby
Database
Python
SEO / Structured Data
WebVR
AMP
TWIG
Horizontal Accordion
jQuery
Backbone
AngularJS
Polyfill
Node.js
Visual Composer
WPLMS
Timber
AMP-WP
ACF
Gutenberg
Shopping
WPML
PMS
SASS
Pre-processor
Flexbox
CSS Grid
General
Alex
DIY
Tech
Podcast
Hardware
LED
Streaming
Mac OSX
Games
Realbasic
Audio production
Backbone
Mobile
Video production
Planning
Timber
Portfolio TV
DIVI
Quality Management
Home Automation
WPML
DIY
Development
Node.js
HTML5
LMS
CSS
Documentation
Development
Changelog
API
Database
Flexbox
Hosting
Podcast
SVG
Shopping
Ruby
PHP
WebRTC
Analytics
Consulting
ACF
Alex
TWIG
AMP-WP
Games
Adwords
Hosting
Polyfill
Essentials
AngularJS
Audit
Setup
Design
WPLMS
AMP
Javascript
CSS Grid
Consulting
Elementor
Gutenberg
Horizontal Accordion
Webdesign
SASS
WebTV / Internet TV / Podcast
Dorit
SEO / Structured Data
Custom Design
Magento
eCommerce / Shopping
PMS
LED
WordPress
WordPress
Streaming
SEO / Structured Data
WPML
Tech
Data Import / Export
WebVR
Python
Solutions
IoT
Security
Portfolio
Maintenance
Localization
jQuery
Pre-processor
Hardware
General
Visual Composer
Strategy
Bootstrap
Print
Mac OSX
Deployment
Learning Management System
Home
•
Archives for
•
Archives for
•
Archives for
18. January 2015
Simple function to randomly reorder a list
var reorder = function(selector){ var ul = document.querySelector(selector); for (var i = ul.children.length; i >= 0; i--) { ul.appendChild(ul.children[Math.random() * i | 0]); } }
1
2
3
4
5
6
7
var
reorder
=
function
(
selector
)
{
var
ul
=
document
.
querySelector
(
selector
)
;
for
(
var
i
=
ul
.
children
.
length
;
i
>=
0
;
i
--
)
{
ul
.
appendChild
(
ul
.
children
[
Math
.
random
(
)
*
i
|
0
]
)
;
}
}
readmore
♩
♪
♫
♬
♩
♪
♫
♬