Looking for the vanilla-lazyload website? 👉 It’s here now. Oh, you didn’t know that I’m the author of a lazy load script? It’s very popular. You can find it on: GitHub npm jsdelivr dedicated website ko-fi ☕ Articles on lazy load Here are some articles about lazy-loading images! Lazy load responsive images in 2020 A smashing article on hybrid lazy loading Native lazy loading and js-based fallback
Using the History API to manage your URLs is awesome and, as it happens, a crucial feature of good web apps. One of its downsides, however, is that scroll positions are stored and then, more importantly, restored whenever you traverse the history. This often means unsightly jumps as the scroll position changes automatically, and especially so if your app does transitions, or changes the contents o
Update (June 2016) Right after I published this blog post I received this response from amazing Node.js developer Vladimir Kurchatkin that JSON parsing is not happening in a different thread and in fact it is blocking the main thread. In this tweet I admited I was wrong and I need to update my post. @j5bot I need to update that post. It's not really in a background thread. It's doing the process i
voronianski.com is coming soon This domain is managed at
Domain Registration in over 1,400 different extensions Enterprise Domain Management since 1999 Mark ProtectTM Online Brand Monitoring and Enforcement Domain Consultancy and Strategy Domain Name Acquisition Domain Disputes and Recovery Web Hosting and Data Center Solutions SSL Management Cyber Security Solutions Please visit www.safenames.net for more information. Europe, Middle East and Africa: +4
While I ended up using a CSS-only implementation for this pen, I started by writing it mostly using classes and JavaScript. However, I had a conflict. I wanted to use Delegated Events but I also wanted to minimize the dependancies I wanted to inject. I didn't want to have to import all of jQuery for this little test, just to be able to use delegated events one bit. Let's take a closer look at what
JavaScriptでオブジェクトの配列(普通の配列でもOK)に対し、あるプロパティの値をキーとして、条件を満たす要素のみを抽出したいときは、array.filter() メソッドを使う。(ソートしたい場合は、ここを参照。) 例えば、以下のような配列があるとする。 // JavaScript gLines = [ { ln_file: "T1301451.json" ln_key: "1301451" ln_name: "[JR]岩泉線 (茂市~岩泉) " }, { ln_file: "T1301541.json" ln_key: "1301541" ln_name: "[JR]北上線 (北上~横手) " }, { ln_file: "T1301671.json" ln_key: "1301671" ln_name: "[JR]磐越東線(ゆうゆうあぶくまライン) (いわき~郡山) " }]
今回はじめてgulpのプラグインを作成したので、どのようにプラグインを作ったのかをまとめておきたいと思います。流れは下のようになります。 プラグイン用のフォルダを作成 package.jsonを作成 index.jsを作成 README.mdを作成 npmのアカウントを作ろう。 1. プラグイン用のフォルダを作成 はじめにプラグイン用のフォルダを作成します。フォルダ名は自分が配布したいパッケージ名にするとよいでしょう。私はgulp-less-to-scssというパッケージを配布したのでフォルダ名をgulp-less-to-scssとしました。 2.package.jsonを作成 次に作成したフォルダの中にpackage.jsonを作成しましょう。 パッケージ名やバージョン、パッケージの説明、依存ファイル等をJSON形式で書いていきます。 私の場合は下のようにpackage.jsonを作成し
Single page applications, Angular.js and accessibility Developers face pretty specific challenges when creating a highly accessible single page application (SPA) user experience. This in-depth tutorial outlines some best practices and accessibility challenges common to SPAs (and specifically Angular apps) so you can build an SPA that works for everyone. How to make usable Angular.js projects We’ve
Checks if the given value type is arguments. var getArguments = function() { return arguments; }; var arguments = getArguments(); is.arguments(arguments); => true is.not.arguments({foo: 'bar'}); => true is.all.arguments(arguments, 'bar'); => false is.any.arguments(['foo'], arguments); => true // 'all' and 'any' interfaces can also take array parameter is.all.arguments([arguments, 'foo', 'bar']); =
node・iojsでもレスポンス改善が期待できます。 waterfallの速度比較taskのサイズによっても速度が大きく変わってくるため、task数の変化による速度変化を調べます。 ツールの仕様は以下の通りです。 task数がlowerからinterval間隔でupperまで実行毎回順番がランダム毎回gcを走らせるn回の平均速度[μs]を計測demo2.jsvar statistic = require('func-comparator').statistic; var _ = require('lodash'); var async = require('async'); var neo_async = require('neo-async'); // サンプリング回数 var times = 100; var create = function(count) { // countはta
JavaScriptは移り変わりの早い言語です。 もう1年以上経っていますし、記事のメンテもちゃんとできていないので、消し線を入れることにしました。 参考程度のために記事は一応残しますが、より新しい情報を読まれることをお勧めいたします。 はじめに --- 最近では JavaScript の実行環境はブラウザに限りません。(node.js, Web Workers) また、旧来のような <script> 経由でのロードもとうに古くなっています。今は CommonJS スタイルで、require を用いたモジュールのロードを行なうことがより良いとされています。 ですから、次のようなことは改める必要があります。 ~~- var YourModule = {}; などとして、外部から YourModule.hoge(); などと呼び出す書き方 this === window だと思うこと~~ 今回
Turn.js is a JavaScript library that will make your content look like a real book or magazine using all the advantages of HTML5. The web is getting beautiful with new user interfaces based in HTML5; turn.js is the best fit for a magazine, book or catalog based in HTML5. <div id="flipbook"> <div class="hard"> Turn.js </div> <div class="hard"></div> <div> Page 1 </div> <div> Page 2 </div> <div> Page
I want to bounce users of our web site to an error page if they're using a version of Internet Explorer prior to v9. It's just not worth our time and money to support IE pre-v9. Users of all other non-IE browsers are fine and shouldn't be bounced. Here's the proposed code: if(navigator.appName.indexOf("Internet Explorer")!=-1){ //yeah, he's using IE var badBrowser=( navigator.appVersion.indexOf("M
This blog post is outdated. Please read chapter “New OOP features besides classes” in “Exploring ES6”. Classes [1] are the major new OOP feature in ECMAScript 6 [2]. However, it also includes new features for object literals and new utility methods in Object. This blog post describes them. New features of object literals # Method definitions # In ECMAScript 5, methods are properties whose values
When writing Node.js or JavaScript applications, you sometimes need to embed multi-line strings in your code. It may be a snippet of HTML, a fragment of textual template, a piece of XML (remember XML?), or code in another programming language. JavaScript has no built-in way of representing multi-line strings. If you need to embed a longer non-JavaScript text in your application the natural options
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く