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
WordPress
SVG
Mac OSX
General
Bootstrap
AngularJS
Tech
WordPress
DIVI
SEO / Structured Data
Localization
Development
Gutenberg
Podcast
Print
Development
AMP-WP
PMS
Dorit
SEO / Structured Data
Mobile
Strategy
Horizontal Accordion
IoT
Audit
Streaming
Security
Shopping
Maintenance
TWIG
Visual Composer
Video production
Backbone
Games
Elementor
WPLMS
HTML5
PHP
Node.js
WebRTC
Changelog
Design
LED
Custom Design
Solutions
Deployment
Portfolio TV
Home Automation
WPML
ACF
DIY
WebVR
Pre-processor
Timber
Database
Quality Management
Essentials
Polyfill
AMP
Planning
Magento
WPML
Ruby
Documentation
Webdesign
Portfolio
eCommerce / Shopping
Python
SASS
Realbasic
Hardware
Consulting
LMS
Javascript
Audio production
API
Learning Management System
Hosting
Adwords
WebTV / Internet TV / Podcast
CSS
Flexbox
CSS Grid
Alex
jQuery
Data Import / Export
Analytics
Consulting
Setup
Hosting
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
♩
♪
♫
♬
♩
♪
♫
♬