Recent Posts

Pages: 1 ... 4 5 [6] 7 8 9
51
JavaScript Operators / Re: ASSIGNMENT OPERATORS
« Last post by slav101 on October 18, 2017, 05:11:21 am »
An assignment operator assigns a value to its left operand based on the value of its right operand.

Overview Edit

The basic assignment operator is equal (=), which assigns the value of its right operand to its left operand. That is, x = y assigns the value of y to x. The other assignment operators are usually shorthand for standard operations, as shown in the following definitions and examples.

Name                                    Shorthand operator                       Meaning
Assignment                                      x = y                                 x = y
Addition assignment                            x += y                              x = x + y
Subtraction assignment                     x -= y                              x = x - y
Multiplication assignment                     x *= y                              x = x * y
Division assignment                             x /= y                              x = x / y
Remainder assignment                    x %= y                             x = x % y
Exponentiation assignment                    x **= y                             x = x ** y
Left shift assignment                           x <<= y                            x = x << y
Right shift assignment                   x >>= y                            x = x >> y
Unsigned right shift assignment          x >>>= y                           x = x >>> y
Bitwise AND assignment                    x &= y                             x = x & y
Bitwise XOR assignment                    x ^= y                             x = x ^ y
Bitwise OR assignment                     x |= y                             x = x | y
AssignmentEdit

Simple assignment operator which assigns a value to a variable. The assignment operation evaluates to the assigned value. Chaining the assignment operator is possible in order to assign a single value to multiple variables. See the example.

Syntax
Operator: x = y

Examples:

// Assuming the following variables
//  x = 5
//  y = 10
//  z = 25

x = y     // x is 10
x = y = z // x, y and z are all 25

Addition assignment Edit

The addition assignment operator adds the value of the right operand to a variable and assigns the result to the variable. The types of the two operands determine the behavior of the addition assignment operator. Addition or concatenation is possible. See the addition operator for more details.

Syntax

Operator: x += y
Meaning:  x  = x + y

Examples

// Assuming the following variables
//  foo = 'foo'
//  bar = 5
//  baz = true


// Number + Number -> addition
bar += 2 // 7

// Boolean + Number -> addition
baz += 1 // 2

// Boolean + Boolean -> addition
baz += false // 1

// Number + String -> concatenation
bar += 'foo' // "5foo"

// String + Boolean -> concatenation
foo += false // "foofalse"

// String + String -> concatenation
foo += 'bar' // "foobar"
Subtraction assignmentEdit

The subtraction assignment operator subtracts the value of the right operand from a variable and assigns the result to the variable. See the subtraction operator for more details.

Syntax

Operator: x -= y
Meaning:  x  = x - y
Examples

// Assuming the following variable
//  bar = 5

bar -= 2     // 3
bar -= 'foo' // NaN

Multiplication assignment Edit

The multiplication assignment operator multiplies a variable by the value of the right operand and assigns the result to the variable. See the multiplication operator for more details.

Syntax

Operator: x *= y
Meaning:  x  = x * y

Examples

// Assuming the following variable
//  bar = 5

bar *= 2     // 10
bar *= 'foo' // NaN

Division assignment Edit

The division assignment operator divides a variable by the value of the right operand and assigns the result to the variable. See the division operator for more details.

Syntax

Operator: x **= y
Meaning:  x  = x ** y

Examples

// Assuming the following variable
//  bar = 5

bar **= 2     // 25
bar **= 'foo' // NaN

Left shift assignment Edit

The left shift assignment operator moves the specified amount of bits to the left and assigns the result to the variable. See the left shift operator for more details.

Syntax

Operator: x <<= y
Meaning:  x   = x << y

Examples

var bar = 5; //  (00000000000000000000000000000101)
bar <<= 2; // 20 (00000000000000000000000000010100)

Right shift assignment Edit

The right shift assignment operator moves the specified amount of bits to the right and assigns the result to the variable. See the right shift operator for more details.

Syntax

Operator: x >>= y
Meaning:  x   = x >> y

Examples

var bar = 5; //   (00000000000000000000000000000101)
bar >>= 2;   // 1 (00000000000000000000000000000001)

var bar -5; //    (-00000000000000000000000000000101)
bar >>= 2;  // -2 (-00000000000000000000000000000010)

Unsigned right shift assignment Edit

The unsigned right shift assignment operator moves the specified amount of bits to the right and assigns the result to the variable. See the unsigned right shift operator for more details.

Syntax

Operator: x >>>= y
Meaning:  x    = x >>> y

Examples

var bar = 5; //   (00000000000000000000000000000101)
bar >>>= 2;  // 1 (00000000000000000000000000000001)

var bar = -5; // (-00000000000000000000000000000101)
bar >>>= 2; // 1073741822 (00111111111111111111111111111110)

Bitwise AND assignment Edit

The bitwise AND assignment operator uses the binary representation of both operands, does a bitwise AND operation on them and assigns the result to the variable. See the bitwise AND operator for more details.

Syntax

Operator: x &= y
Meaning:  x  = x & y

Example

var bar = 5;
// 5:     00000000000000000000000000000101
// 2:     00000000000000000000000000000010
bar &= 2; // 0

Bitwise XOR assignment Edit

The bitwise XOR assignment operator uses the binary representation of both operands, does a bitwise XOR operation on them and assigns the result to the variable. See the bitwise XOR operator for more details.

Syntax

Operator: x ^= y
Meaning:  x  = x ^ y

Example

var bar = 5;
bar ^= 2; // 7
// 5: 00000000000000000000000000000101
// 2: 00000000000000000000000000000010
// -----------------------------------
// 7: 00000000000000000000000000000111

Bitwise OR assignment Edit

The bitwise OR assignment operator uses the binary representation of both operands, does a bitwise OR operation on them and assigns the result to the variable. See the bitwise OR operator for more details.

Syntax

Operator: x |= y
Meaning:  x  = x | y

Example

var bar = 5;
bar |= 2; // 7
// 5: 00000000000000000000000000000101
// 2: 00000000000000000000000000000010
// -----------------------------------
// 7: 00000000000000000000000000000111

Examples Edit

Left operand with another assignment operator
In unusual situations, the assignment operator (e.g. x += y) is not identical to the meaning expression (here x = x + y). When the left operand of an assignment operator itself contains an assignment operator, the left operand is evaluated only once. For example:

a[i++] += 5         // i is evaluated only once
a[i++] = a[i++] + 5 // i is evaluated twice

Syntax

Operator: x /= y
Meaning:  x  = x / y

Examples

// Assuming the following variable
//  bar = 5

bar /= 2     // 2.5
bar /= 'foo' // NaN
bar /= 0     // Infinity

Remainder assignment Edit

The remainder assignment operator divides a variable by the value of the right operand and assigns the remainder to the variable. See the remainder operator for more details.

Syntax

Operator: x %= y
Meaning:  x  = x % y

Examples

// Assuming the following variable
//  bar = 5

bar %= 2     // 1
bar %= 'foo' // NaN
bar %= 0     // NaN

52
CSS Fonts, Icons, Links / Re: CSS LINKS
« Last post by achosierry on October 18, 2017, 05:06:22 am »
I am using Sublime Text to make my own website and Code Academy to help me learn! But I do not know how to link the css and the html. I have done the lesson were you do that and successfully completed it, but I can not get it to work in Sublime Text. Any help would be greatly appreciated.
53
CSS Fonts, Icons, Links / Re: CSS ICONS
« Last post by aireenrosas on October 18, 2017, 05:04:08 am »
in adding icons you can used

Font Awesome Icons
To use the Font Awesome icons, add the following line inside the <head> section of your HTML page:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

Note: No downloading or installation is required!

Bootstrap Icons and
To use the Bootstrap glyphicons, add the following line inside the <head> section of your HTML page:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Note: No downloading or installation is required!

Google Icons
To use the Google icons, add the following line inside the <head> section of your HTML page:

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

Note: No downloading or installation is required!

you only have to include it inside your header..
54
CSS Fonts, Icons, Links / Re: CSS ICONS
« Last post by achosierry on October 18, 2017, 05:03:18 am »
hi!!! in css the are some codes for colors right like ex: AliceBlue    #F0F8FF is this codes also applicable in here??????
 
55
CSS Fonts, Icons, Links / Re: CSS ICONS
« Last post by slav101 on October 18, 2017, 05:00:01 am »
How To Add Icons:

The simplest way to add an icon to your HTML page, is with an icon library, such as Font Awesome.

Add the name of the specified icon class to any inline HTML element (like <i> or <span>).

All the icons in the icon libraries below, are scalable vectors that can be customized with CSS (size, color, shadow, etc.)

Font Awesome Icons:

To use the Font Awesome icons, add the following line inside the <head> section of your HTML page:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

Example

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>

<i class="fa fa-cloud"></i>
<i class="fa fa-heart"></i>
<i class="fa fa-car"></i>
<i class="fa fa-file"></i>
<i class="fa fa-bars"></i>

</body>
</html>

Note: Primarily these are used to create an  icon style on web pages that uses coding styles such as HTML / SML / SHTML / XML / etc.

These practically helps define the specific point of a website.
56
CSS Fonts, Icons, Links / Re: CSS ICONS
« Last post by aireenrosas on October 18, 2017, 04:59:53 am »
yes you can just add your codes inside the


<style>
div {
    height: 100px;
    width: 500px;
    background-color: powderblue;
}
</style>



or

<img src="https://www.computerhope.com/cdn/computer-hope.jpg" width="200" height="40" alt="Computer Hope">
57
CSS Fonts, Icons, Links / Re: CSS LINKS
« Last post by slav101 on October 18, 2017, 04:59:40 am »
NO!!! Not all are in the header part. Please do take note that the end strings usually are on the end sector of each pages / program. Please observe your programming codes carefully so as not to make errors in programming.
58
CSS Fonts, Icons, Links / Re: CSS LINKS
« Last post by aireenrosas on October 18, 2017, 04:53:39 am »
yes....

this is a sample code

Usually, all these properties are kept in the header part of the HTML document.

Remember a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective. Also, a:active MUST come after a:hover in the CSS definition as follows −

<style type="text/css">
   a:link {color: #000000}
   a:visited {color: #006600}
   a:hover {color: #FFCC00}
   a:active {color: #FF00CC}
</style>
59
CSS Fonts, Icons, Links / Re: CSS LINKS
« Last post by slav101 on October 18, 2017, 04:51:51 am »
HYPERLINKS (LINKS)

Hyperlinks (or links) connect Web pages. They are what make the Web work, enabling us to travel from one page to the next at the click of a button.

So without links, we’d be lost. We look for them on the page when we want to venture further. Sure, we pause to read a bit, but inevitably we end up clicking a link of some sort while at the least.

Styling Links Link

When you style links, remember that users don’t read; they scan. You’ve heard that before, and it’s true. So, make sure your links are obvious. They should also indicate where they will take the user.
Let’s start by looking at CSS selectors and pseudo-classes:
a:link { }
Unvisited link.
a:visited { }
Visited links.
a:hover { }
The user mouses over a link.
a:focus { }
The user clicks on a link.
a:active { }
The user has clicked a link.

ENSURE CONTRAST LINK

Links should stand out not only from the background but from the surrounding text. If the font color is black and the link color is black, you have a problem. Make your links stand out by using one or more than one of the following techniques.
text-decoration: underline;
Underline.
font-weight: bold;
Bold.
font-size: 1.4em;
Enlarge.
color: #ed490a;
Color.
background-color: #c0c0c0;
Background.
border-bottom: 2px solid #a959c3;
Border.

If you decide to make links blue, then make sure no other text (including headings) is blue, because users will expect it to be a link, too.
Also, don’t underline text that isn’t linked because users expect underlined text to be a link. And keep in mind users with poor sight. Red won’t stand out to someone who is color blind, so consider underlining or bolding links, in addition to changing the color.
60
JavaScript Operators / Re: ASSIGNMENT OPERATORS
« Last post by Emary Echo on October 18, 2017, 04:48:54 am »
Assignment operation code or commands carry out assignment operations. Simple assignment operations consist of taking the value on the right side of the operator and assigning it to the variable on the left, as in this example:
Pages: 1 ... 4 5 [6] 7 8 9