Skip to content

Commit 78a8ef1

Browse files
committed
add code highlighting
1 parent 02c605d commit 78a8ef1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fernando/_posts/2015-01-19-optimizing-spa-splash-page.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,19 @@ the source of the image.
2424

2525
CODE HERE
2626

27-
img = new Image
28-
img.src = 'image/source.png'
27+
{% highlight javascript %}
28+
img = new Image;
29+
img.src = 'image/source.png';
30+
{% endhighlight %}
2931

3032
And placing this inline at the top of the html page before any calls to the JS or CSS, GETs
3133
image before anything else. For more bonus points in quick loading don't use any jQuery, just
3234
straight JS and it will shave a few milliseconds. And for even more make a low res picture and
3335
overlap the images using the CSS background comma spearated.
3436

37+
{% highlight css %}
3538
background-image: url(low-res.png), url(high-res.png);
39+
{% endhighlight %}
3640

3741
This will basically load the first image on the list and once the next image is complete it will
3842
overlap it in a sudden blink. The effect is pretty suddle if you aren't looking for it.

0 commit comments

Comments
 (0)