minor fixes
This commit is contained in:
parent
9fcffe1692
commit
15f7acfc2a
15 changed files with 17 additions and 17 deletions
|
@ -73,7 +73,7 @@ Script files are attached to HTML with the `src` attribute:
|
|||
<script src="/path/to/script.js"></script>
|
||||
```
|
||||
|
||||
Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder.
|
||||
Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"`, just like `src="./script.js"`, would mean a file `"script.js"` in the current folder.
|
||||
|
||||
We can give a full URL as well. For instance:
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
text-align: center;
|
||||
}
|
||||
.circle {
|
||||
transition-property: width, height, margin-left, margin-top;
|
||||
transition-property: width, height;
|
||||
transition-duration: 2s;
|
||||
position: fixed;
|
||||
transform: translateX(-50%) translateY(-50%);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<div id="carousel" class="carousel">
|
||||
<button class="arrow prev">⇦</button>
|
||||
<div class="gallery">
|
||||
<ul class="images">
|
||||
<ul>
|
||||
<li><img src="https://en.js.cx/carousel/1.png"></li>
|
||||
<li><img src="https://en.js.cx/carousel/2.png"></li>
|
||||
<li><img src="https://en.js.cx/carousel/3.png"></li>
|
||||
|
|
|
@ -88,7 +88,7 @@ class HoverIntent {
|
|||
if (speed < this.sensitivity) {
|
||||
clearInterval(this.checkSpeedInterval);
|
||||
this.isHover = true;
|
||||
this.over.call(this.elem, event);
|
||||
this.over.call(this.elem);
|
||||
} else {
|
||||
// speed fast, remember new coordinates as the previous ones
|
||||
this.prevX = this.lastX;
|
||||
|
|
|
@ -126,9 +126,9 @@ new TypedArray();
|
|||
|
||||
We can create a `TypedArray` directly, without mentioning `ArrayBuffer`. But a view cannot exist without an underlying `ArrayBuffer`, so gets created automatically in all these cases except the first one (when provided).
|
||||
|
||||
To access the `ArrayBuffer`, there are properties:
|
||||
- `arr.buffer` -- references the `ArrayBuffer`.
|
||||
- `arr.byteLength` -- the length of the `ArrayBuffer`.
|
||||
To access the underlying `ArrayBuffer`, there are following properties in `TypedArray`:
|
||||
- `buffer` -- references the `ArrayBuffer`.
|
||||
- `byteLength` -- the length of the `ArrayBuffer`.
|
||||
|
||||
So, we can always move from one view to another:
|
||||
```js
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta charset="utf-8">
|
||||
<style>
|
||||
.circle {
|
||||
transition-property: width, height, margin-left, margin-top;
|
||||
transition-property: width, height;
|
||||
transition-duration: 2s;
|
||||
position: fixed;
|
||||
transform: translateX(-50%) translateY(-50%);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta charset="utf-8">
|
||||
<style>
|
||||
.circle {
|
||||
transition-property: width, height, margin-left, margin-top;
|
||||
transition-property: width, height;
|
||||
transition-duration: 2s;
|
||||
position: fixed;
|
||||
transform: translateX(-50%) translateY(-50%);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
text-align: center;
|
||||
}
|
||||
.circle {
|
||||
transition-property: width, height, margin-left, margin-top;
|
||||
transition-property: width, height;
|
||||
transition-duration: 2s;
|
||||
position: fixed;
|
||||
transform: translateX(-50%) translateY(-50%);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
}
|
||||
|
||||
function bounce(timeFraction) {
|
||||
for (let a = 0, b = 1, result; 1; a += b, b /= 2) {
|
||||
for (let a = 0, b = 1; 1; a += b, b /= 2) {
|
||||
if (timeFraction >= (7 - 4 * a) / 11) {
|
||||
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
}
|
||||
|
||||
function bounce(timeFraction) {
|
||||
for (let a = 0, b = 1, result; 1; a += b, b /= 2) {
|
||||
for (let a = 0, b = 1; 1; a += b, b /= 2) {
|
||||
if (timeFraction >= (7 - 4 * a) / 11) {
|
||||
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ The `bounce` function does the same, but in the reverse order: "bouncing" starts
|
|||
|
||||
```js
|
||||
function bounce(timeFraction) {
|
||||
for (let a = 0, b = 1, result; 1; a += b, b /= 2) {
|
||||
for (let a = 0, b = 1; 1; a += b, b /= 2) {
|
||||
if (timeFraction >= (7 - 4 * a) / 11) {
|
||||
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
|
||||
function bounce(timeFraction) {
|
||||
for (let a = 0, b = 1, result; 1; a += b, b /= 2) {
|
||||
for (let a = 0, b = 1; 1; a += b, b /= 2) {
|
||||
if (timeFraction >= (7 - 4 * a) / 11) {
|
||||
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
}
|
||||
|
||||
function bounce(timeFraction) {
|
||||
for (let a = 0, b = 1, result; 1; a += b, b /= 2) {
|
||||
for (let a = 0, b = 1; 1; a += b, b /= 2) {
|
||||
if (timeFraction >= (7 - 4 * a) / 11) {
|
||||
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
animate({
|
||||
duration: 3000,
|
||||
timing: function bounce(timeFraction) {
|
||||
for (let a = 0, b = 1, result; 1; a += b, b /= 2) {
|
||||
for (let a = 0, b = 1; 1; a += b, b /= 2) {
|
||||
if (timeFraction >= (7 - 4 * a) / 11) {
|
||||
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ And stood awhile in thought.
|
|||
|
||||
|
||||
function bounce(timeFraction) {
|
||||
for (let a = 0, b = 1, result; 1; a += b, b /= 2) {
|
||||
for (let a = 0, b = 1; 1; a += b, b /= 2) {
|
||||
if (timeFraction >= (7 - 4 * a) / 11) {
|
||||
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue