Skip to content

Instantly share code, notes, and snippets.

@salehahmadbabu
Created September 25, 2018 07:29
Show Gist options
  • Save salehahmadbabu/799215e2b4409dc418dbcfe8b47f7274 to your computer and use it in GitHub Desktop.
Save salehahmadbabu/799215e2b4409dc418dbcfe8b47f7274 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</head>
<body>
<div style="height: 100%;; width: 100%;">
<img src="1.jpg" height="100%" width="600" style=" position: fixed;" alt="#">
</div>
<div>
Null and undefined ─ Are they the same?
The null and the undefined datatypes are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be assigned as values to a variable.
However, null and undefined are not the same. A variable initialized with undefined means that the variable has no value or object assigned to it while null means that the variable has been set to an object whose value is undefined.<br>
User-defined Types
User-defined types include Enumerations (enums), classes, interfaces, arrays, and tuple. These are discussed in detail in the later chapters.Null and undefined ─ Are they the same?<br>
The null and the undefined datatypes are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be assigned as values to a variable.
However, null and <br>undefined are not the same. A variable initialized with undefined means that the variable has no value or object assigned to it while null means that the variable has been set to an object whose value is undefined.
<br>
User-defined Types
User-defined types include Enumerations (enums), classes, interfaces, arrays, and tuple. These are discussed in detail in the later chapters.Null and undefined ─ Are they the same?
The null and the undefined datatypes are often a source of confusion. The null and undefined cannot be used to refe<br>rence the data type of a variable. They can only be assigned as values to a variable.
However, null and undefined are not the same. A variable initialized with undefined means that the variable has no value or object assigned to it while null means that the variable has been set to an object whose value is undefined.
<br>
User-defined Types
User-defined types include Enumerations (enums), classes, interfaces, arrays, and tuple. These are discussed in detail in the later chapters.Null and undefined ─ Are they the same?
<br>The null and the undefined datatypes are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be assigned as values to a variable.
However, null and undefined are not the same. A variable initialized with undefined means that the variable has no value or object assigned to it while null means that the variable has been set to an object whose value is undefined.
<br>
User-defined Types
User-defined types include Enumerations (enums), classes, interfaces, arrays, and tuple. These are discussed in detail in the later chapters.Null and undefined ─ Are they the same?<br>
The null and the undefined datatypes are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be assigned as values to a variable.
<br>
However, null and undefined are not the same. A variable initialized with undefined means that the variable has no value or object assigned to it while null means that the variable has been set to an object whose value is undefined.<br>
User-defined Types
User-defined types include Enumerations (enums), classes, interfaces, arrays, and tuple. These are discussed in detail in the later chapters.Null and undefined ─ Are they the same?<br>
The null and the undefined datatypes are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be assigned as values to a variable.
<br>
However, null and undefined are not the same. A variable initialized with undefined means that the variable has no value or object assigned to it while null means that the variable has been set to an object whose value is undefined.
<br>
User-defined Types
User-defined types include Enumerations (enums), classes, interfaces, arrays, and tuple. These are discussed in detail in the later chapte<br>
The null and the undefined datatypes are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be assigned as values to a variable.
<br>
However, null and undefined are not the same. A variable initialized with undefined means that the variable has no value or object assigned to it while null means that the variable has been set to an object whose value is undefined.
User-defined Types<br>
User-defined types include Enumerations (enums), classes, interfaces, arrays, and tuple. These are discussed in detail in the later chapters.Null and undefined ─ Are they the same?
The null and the undefined datatypes are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be assigned as values to a variable.<br>
However, null and undefined are not the same. A variable initialized with undefined means that the variable has no value or object assigned to it while null means that the variable has been set to an object whose value is undefined.
User-defined Types
User-defined types include Enumerations (enums), classes, interfaces, arrays, and tuple. These are discussed in detail in the later chapters.
</div>
<script>
$(function(){
$(window).scroll(function() {
var img = $("div img");
var scroll = $(window).scrollTop();
console.log(scroll);
if (scroll < 80) {
var img = img.attr({
src: '1.jpg',
alt: 'this is no 1'
});
return img;
}
if (scroll < 150) {
var img = img.attr(
"src", "2.jpg");
return img;
}
if (scroll < 250) {
var img = img.attr("src", "3.jpg");
return img;
}
if (scroll < 400) {
var img = img.attr("src", "4.jpg");
return img;
}
if (scroll < 550) {
var img = img.attr("src", "5.jpg");
return img;
}
if (scroll < 700) {
var img = img.attr("src", "6.jpg");
return img;
}
var img;
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment