SlideShare a Scribd company logo
Notes
1-this is web programming ... HTML
2-I need the calculator look exacly what in the picture with buttons 1 through 9( see the picture )
3- I have tried to do it but is not complete and my code ( the calculator acting wrong )
4- for example if I enter ( 9*9 ) I should get 81 and so on..... make sure ( - , + , / , and * )
working like other calculator please
5- here is the picture of the calculator with the requierments and my code also...
6- once you done, please copy and paste the code here. not provide code with picture. thanks in
advance...
1-!DOCTYPE html
2-html
3-head
4-style
/*table {
border-spacing: 0;
width: 400px;
height: 400px;
background-color: #81C7D4;
}
tr {
height: 200px;
}
td {
padding: 0;
margin: 0;
height: 200px;
} */
#monitor {
margin: 20px;
width: 360px;
height: 160px;
border: 0px;
background-color: white;
font-family: monospace;
text-align: right;
font-size: 160px;
}
div.button1 {
position: relative;
margin: 20px;
width: 160px;
height: 360px;
border: 0;
background-color: #A5DEE4;
font-family: monospace;
font-size: 150px;
text-align: center;
cursor: pointer;
-webkit-user-select: none;
}
div.button2 {
position: relative;
margin: 20px;
width: 360px;
height: 160px;
border: 0;
background-color: #A5DEE4;
font-family: monospace;
font-size: 150px;
text-align: center;
cursor: pointer;
-webkit-user-select: none;
}
div.button {
position: relative;
margin: 20px;
width: 160px;
height: 160px;
border: 0;
background-color: #A5DEE4;
font-family: monospace;
font-size: 150px;
text-align: center;
cursor: pointer;
-webkit-user-select: none;
}
div.button:hover {
position: relative;
top: -5px;
left: -5px;
box-shadow: 10px 10px 10px;
}
div.button:active {
position: relative;
top: 5px;
left: 5px;
box-shadow: 0 0 0;
}
Demo
0
+
-
*
/
7
8
9
4
5
6
C
1
2
3
0
.
= In this assignment, you will develop a simple calculator similar to the following example 7 8 9
C
Solution
HTML:
Del%+
789-
456x
123/
0.=
CSS:
body {
background:#777;
}
#background {
width:300px;
height:400px;
background:gray;
margin:50px auto;
-webkit-animation:bgChange 2s 2s alternate infinite;
transition: all 2s ease;
}
button {
border:0;
color:#fff;
}
#result {
display:block;
font-family: sans-serif;
width:230px;
height:40px;
margin:10px auto;
text-align: right;
border:0;
background:#3b3535;
color:#fff;
padding-top:20px;
font-size:20px;
margin-left: 25px;
outline: none;
overflow: hidden;
letter-spacing: 4px;
position: relative;
top:10px;
}
#result:hover {
cursor: text;
}
#first-rows {
margin-bottom: 20px;
position: relative;
top:10px;
}
.rows {
width:300px;
margin-top:10px;
}
#delete {
width:110px;
height:50px;
margin-left:25px;
border-radius:4px;
}
/* Aligning the division and dot button properly */
.fall-back {
margin-left:3px !important;
}
/* Aligning the addition and equals to button properly */
.align {
margin-left: 6px !important;
}
/* Button styling */
.btn-style {
width:50px;
height:50px;
margin-left:5px;
border-radius:4px;
}
.eqn {
width:50px;
height:50px;
margin-left:5px;
border-radius:4px;
}
.first-child {
margin-left:25px;
}
/* Adding background color to the number values */
.num-bg {
background:#000;
color:#fff;
font-size:26px;
cursor:pointer;
outline:none;
border-bottom:3px solid #333;
}
.num-bg:active {
background:#000;
color:#fff;
font-size:26px;
cursor:pointer;
outline:none;
box-shadow: inset 5px 5px 5px #555;
}
/*Adding background color to the operator values */
.opera-bg {
background:#333;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
border-bottom:3px solid #555;
}
.opera-bg:active {
background:#333;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
box-shadow: inset 4px 4px 4px #555;
}
/*Adding a background color to the delete button */
.del-bg {
background:#24b4de;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
border-bottom:3px solid #399cb9;
}
.del-bg:active {
background:#24b4de;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
box-shadow: inset 4px 4px 4px #399cb9;
}
/*Adding a background color to the equals to button */
#eqn-bg {
background:#17a928;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
border-bottom:3px solid #1f7a29;
}
#eqn-bg:active {
background:#17a928;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
box-shadow: inset 4px 4px 4px #1f7a29;
}
@-webkit-keyframes bgChange {
0% {
background:#24b4de;
}
50% {
background:#17a928;
}
100% {
background:#399cb9;
}
}
JS:
window.onload = function() {
var current,
screen,
output,
limit,
zero,
period,
operator;
screen = document.getElementById("result");
var elem = document.querySelectorAll(".num");
var len = elem.length;
for(var i = 0; i < len; i++ ) {
elem[i].addEventListener("click",function() {
num = this.value;
output = screen.innerHTML +=num;
limit = output.length;
if(limit > 16 ) {
alert("Sorry no more input is allowed");
}
},false);
}
document.querySelector(".zero").addEventListener("click",function() {
zero = this.value;
if(screen.innerHTML === "") {
output = screen.innerHTML = zero;
}
else if(screen.innerHTML === output) {
output = screen.innerHTML +=zero;
}
},false);
document.querySelector(".period").addEventListener("click",function() {
period = this.value;
if(screen.innerHTML === "") {
output = screen.innerHTML = screen.innerHTML.concat("0.");
}
else if(screen.innerHTML === output) {
screen.innerHTML = screen.innerHTML.concat(".");
}
},false);
document.querySelector("#eqn-bg").addEventListener("click",function() {
if(screen.innerHTML === output) {
screen.innerHTML = eval(output);
}
else {
screen.innerHTML = "";
}
},false);
document.querySelector("#delete").addEventListener("click",function() {
screen.innerHTML = "";
},false);
var elem1 = document.querySelectorAll(".operator");
var len1 = elem1.length;
for(var i = 0; i < len1; i++ ) {
elem1[i].addEventListener("click",function() {
operator = this.value;
if(screen.innerHTML === "") {
screen.innerHTML = screen.innerHTML.concat("");
}
else if(output) {
screen.innerHTML = output.concat(operator);
}
},false);
}
}

More Related Content

Similar to Notes1-this is web programming ... HTML2-I need the calculator l.pdf

Yeni metin belgesi (2)
Yeni metin belgesi (2)Yeni metin belgesi (2)
Yeni metin belgesi (2)
makarnalar
 
Theme04
Theme04Theme04
Theme02
Theme02Theme02
Floating ad widget
Floating ad widgetFloating ad widget
Floating ad widget
panther420
 
Theme01
Theme01Theme01
Xlrays online web tutorials
Xlrays online web tutorialsXlrays online web tutorials
Xlrays online web tutorials
Yogesh Gupta
 
Css(handbook)
Css(handbook)Css(handbook)
Css(handbook)
MD. Anamul Haque
 
Teddy Bear Blue
Teddy Bear BlueTeddy Bear Blue
Teddy Bear Blue
angeliclv
 
i tried my best to look the exact same from the picture- but some code.pdf
i tried my best to look the exact same from the picture- but some code.pdfi tried my best to look the exact same from the picture- but some code.pdf
i tried my best to look the exact same from the picture- but some code.pdf
bolero3277
 
Hello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdfHello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdf
absgroup9793
 
Stylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartStylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStart
Scott DeLoach
 
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
dezyneecole
 
Resume
ResumeResume
Resume
maddineni03
 
Resume
ResumeResume
Resume
maddineni03
 
Resume
ResumeResume
Resume
maddineni03
 
IML 140 Design - Basics
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - Basics
Evan Hughes
 
Spl book salution
Spl book salutionSpl book salution
Spl book salution
ahonaislamonti
 
Extracting ui Design - part 3 - transcript.pdf
Extracting ui Design - part 3 - transcript.pdfExtracting ui Design - part 3 - transcript.pdf
Extracting ui Design - part 3 - transcript.pdf
ShaiAlmog1
 
Theme verdadeiro
Theme verdadeiroTheme verdadeiro
Theme verdadeiro
Izabelly Souza
 
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docx
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docxPractical ActivitiesWeek06lab08-1.pngPractical Activities.docx
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docx
ChantellPantoja184
 

Similar to Notes1-this is web programming ... HTML2-I need the calculator l.pdf (20)

Yeni metin belgesi (2)
Yeni metin belgesi (2)Yeni metin belgesi (2)
Yeni metin belgesi (2)
 
Theme04
Theme04Theme04
Theme04
 
Theme02
Theme02Theme02
Theme02
 
Floating ad widget
Floating ad widgetFloating ad widget
Floating ad widget
 
Theme01
Theme01Theme01
Theme01
 
Xlrays online web tutorials
Xlrays online web tutorialsXlrays online web tutorials
Xlrays online web tutorials
 
Css(handbook)
Css(handbook)Css(handbook)
Css(handbook)
 
Teddy Bear Blue
Teddy Bear BlueTeddy Bear Blue
Teddy Bear Blue
 
i tried my best to look the exact same from the picture- but some code.pdf
i tried my best to look the exact same from the picture- but some code.pdfi tried my best to look the exact same from the picture- but some code.pdf
i tried my best to look the exact same from the picture- but some code.pdf
 
Hello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdfHello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdf
 
Stylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartStylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStart
 
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
 
Resume
ResumeResume
Resume
 
Resume
ResumeResume
Resume
 
Resume
ResumeResume
Resume
 
IML 140 Design - Basics
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - Basics
 
Spl book salution
Spl book salutionSpl book salution
Spl book salution
 
Extracting ui Design - part 3 - transcript.pdf
Extracting ui Design - part 3 - transcript.pdfExtracting ui Design - part 3 - transcript.pdf
Extracting ui Design - part 3 - transcript.pdf
 
Theme verdadeiro
Theme verdadeiroTheme verdadeiro
Theme verdadeiro
 
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docx
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docxPractical ActivitiesWeek06lab08-1.pngPractical Activities.docx
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docx
 

More from aminbijal86

can someone proofread this for meAs a child, I used to watch T.V..pdf
can someone proofread this for meAs a child, I used to watch T.V..pdfcan someone proofread this for meAs a child, I used to watch T.V..pdf
can someone proofread this for meAs a child, I used to watch T.V..pdf
aminbijal86
 
Describe the arrangement of Regulations for lifting machines and acc.pdf
Describe the arrangement of Regulations for lifting machines and acc.pdfDescribe the arrangement of Regulations for lifting machines and acc.pdf
Describe the arrangement of Regulations for lifting machines and acc.pdf
aminbijal86
 
All of the following would require use of the equity method for inve.pdf
All of the following would require use of the equity method for inve.pdfAll of the following would require use of the equity method for inve.pdf
All of the following would require use of the equity method for inve.pdf
aminbijal86
 
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdfA nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
aminbijal86
 
Bell & Porter has the following average times (in hours) Inspecting .pdf
Bell & Porter has the following average times (in hours) Inspecting .pdfBell & Porter has the following average times (in hours) Inspecting .pdf
Bell & Porter has the following average times (in hours) Inspecting .pdf
aminbijal86
 
Which part of the clavicle is most commonly fractured A. Later.pdf
Which part of the clavicle is most commonly fractured A. Later.pdfWhich part of the clavicle is most commonly fractured A. Later.pdf
Which part of the clavicle is most commonly fractured A. Later.pdf
aminbijal86
 
Which of the following is NOT a criticism of the National Bureau of .pdf
Which of the following is NOT a criticism of the National Bureau of .pdfWhich of the following is NOT a criticism of the National Bureau of .pdf
Which of the following is NOT a criticism of the National Bureau of .pdf
aminbijal86
 
When working with communications, is it more important to detect or .pdf
When working with communications, is it more important to detect or .pdfWhen working with communications, is it more important to detect or .pdf
When working with communications, is it more important to detect or .pdf
aminbijal86
 
Which of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdfWhich of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdf
aminbijal86
 
Thouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdfThouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdf
aminbijal86
 
Two of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdfTwo of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdf
aminbijal86
 
The systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdfThe systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdf
aminbijal86
 
One implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdfOne implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdf
aminbijal86
 
the problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdfthe problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdf
aminbijal86
 
The first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdfThe first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdf
aminbijal86
 
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdfThe Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
aminbijal86
 
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdfSubmit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
aminbijal86
 
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdfNessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
aminbijal86
 
Solve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdfSolve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdf
aminbijal86
 
Show a rightmost derivation for the string(id + id) id Usin.pdf
Show a rightmost derivation for the string(id + id)  id Usin.pdfShow a rightmost derivation for the string(id + id)  id Usin.pdf
Show a rightmost derivation for the string(id + id) id Usin.pdf
aminbijal86
 

More from aminbijal86 (20)

can someone proofread this for meAs a child, I used to watch T.V..pdf
can someone proofread this for meAs a child, I used to watch T.V..pdfcan someone proofread this for meAs a child, I used to watch T.V..pdf
can someone proofread this for meAs a child, I used to watch T.V..pdf
 
Describe the arrangement of Regulations for lifting machines and acc.pdf
Describe the arrangement of Regulations for lifting machines and acc.pdfDescribe the arrangement of Regulations for lifting machines and acc.pdf
Describe the arrangement of Regulations for lifting machines and acc.pdf
 
All of the following would require use of the equity method for inve.pdf
All of the following would require use of the equity method for inve.pdfAll of the following would require use of the equity method for inve.pdf
All of the following would require use of the equity method for inve.pdf
 
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdfA nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
 
Bell & Porter has the following average times (in hours) Inspecting .pdf
Bell & Porter has the following average times (in hours) Inspecting .pdfBell & Porter has the following average times (in hours) Inspecting .pdf
Bell & Porter has the following average times (in hours) Inspecting .pdf
 
Which part of the clavicle is most commonly fractured A. Later.pdf
Which part of the clavicle is most commonly fractured A. Later.pdfWhich part of the clavicle is most commonly fractured A. Later.pdf
Which part of the clavicle is most commonly fractured A. Later.pdf
 
Which of the following is NOT a criticism of the National Bureau of .pdf
Which of the following is NOT a criticism of the National Bureau of .pdfWhich of the following is NOT a criticism of the National Bureau of .pdf
Which of the following is NOT a criticism of the National Bureau of .pdf
 
When working with communications, is it more important to detect or .pdf
When working with communications, is it more important to detect or .pdfWhen working with communications, is it more important to detect or .pdf
When working with communications, is it more important to detect or .pdf
 
Which of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdfWhich of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdf
 
Thouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdfThouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdf
 
Two of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdfTwo of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdf
 
The systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdfThe systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdf
 
One implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdfOne implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdf
 
the problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdfthe problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdf
 
The first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdfThe first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdf
 
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdfThe Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
 
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdfSubmit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
 
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdfNessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
 
Solve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdfSolve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdf
 
Show a rightmost derivation for the string(id + id) id Usin.pdf
Show a rightmost derivation for the string(id + id)  id Usin.pdfShow a rightmost derivation for the string(id + id)  id Usin.pdf
Show a rightmost derivation for the string(id + id) id Usin.pdf
 

Recently uploaded

ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
dot55audits
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
spdendr
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
Amin Marwan
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
Chevonnese Chevers Whyte, MBA, B.Sc.
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 

Recently uploaded (20)

ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 

Notes1-this is web programming ... HTML2-I need the calculator l.pdf

  • 1. Notes 1-this is web programming ... HTML 2-I need the calculator look exacly what in the picture with buttons 1 through 9( see the picture ) 3- I have tried to do it but is not complete and my code ( the calculator acting wrong ) 4- for example if I enter ( 9*9 ) I should get 81 and so on..... make sure ( - , + , / , and * ) working like other calculator please 5- here is the picture of the calculator with the requierments and my code also... 6- once you done, please copy and paste the code here. not provide code with picture. thanks in advance... 1-!DOCTYPE html 2-html 3-head 4-style /*table { border-spacing: 0; width: 400px; height: 400px; background-color: #81C7D4; } tr { height: 200px; } td { padding: 0; margin: 0; height: 200px; } */ #monitor { margin: 20px; width: 360px; height: 160px; border: 0px; background-color: white; font-family: monospace; text-align: right;
  • 2. font-size: 160px; } div.button1 { position: relative; margin: 20px; width: 160px; height: 360px; border: 0; background-color: #A5DEE4; font-family: monospace; font-size: 150px; text-align: center; cursor: pointer; -webkit-user-select: none; } div.button2 { position: relative; margin: 20px; width: 360px; height: 160px; border: 0; background-color: #A5DEE4; font-family: monospace; font-size: 150px; text-align: center; cursor: pointer; -webkit-user-select: none; } div.button { position: relative; margin: 20px; width: 160px; height: 160px; border: 0; background-color: #A5DEE4; font-family: monospace;
  • 3. font-size: 150px; text-align: center; cursor: pointer; -webkit-user-select: none; } div.button:hover { position: relative; top: -5px; left: -5px; box-shadow: 10px 10px 10px; } div.button:active { position: relative; top: 5px; left: 5px; box-shadow: 0 0 0; } Demo 0 + - * / 7 8 9 4 5 6 C 1 2 3 0 . = In this assignment, you will develop a simple calculator similar to the following example 7 8 9
  • 4. C Solution HTML: Del%+ 789- 456x 123/ 0.= CSS: body { background:#777; } #background { width:300px; height:400px; background:gray; margin:50px auto; -webkit-animation:bgChange 2s 2s alternate infinite; transition: all 2s ease; } button { border:0; color:#fff; } #result { display:block; font-family: sans-serif; width:230px; height:40px; margin:10px auto;
  • 5. text-align: right; border:0; background:#3b3535; color:#fff; padding-top:20px; font-size:20px; margin-left: 25px; outline: none; overflow: hidden; letter-spacing: 4px; position: relative; top:10px; } #result:hover { cursor: text; } #first-rows { margin-bottom: 20px; position: relative; top:10px; } .rows { width:300px; margin-top:10px; } #delete { width:110px; height:50px; margin-left:25px; border-radius:4px; } /* Aligning the division and dot button properly */ .fall-back { margin-left:3px !important;
  • 6. } /* Aligning the addition and equals to button properly */ .align { margin-left: 6px !important; } /* Button styling */ .btn-style { width:50px; height:50px; margin-left:5px; border-radius:4px; } .eqn { width:50px; height:50px; margin-left:5px; border-radius:4px; } .first-child { margin-left:25px; } /* Adding background color to the number values */ .num-bg { background:#000; color:#fff; font-size:26px; cursor:pointer; outline:none; border-bottom:3px solid #333; } .num-bg:active { background:#000; color:#fff; font-size:26px; cursor:pointer;
  • 7. outline:none; box-shadow: inset 5px 5px 5px #555; } /*Adding background color to the operator values */ .opera-bg { background:#333; color:#fff; font-size:26px; cursor: pointer; outline:none; border-bottom:3px solid #555; } .opera-bg:active { background:#333; color:#fff; font-size:26px; cursor: pointer; outline:none; box-shadow: inset 4px 4px 4px #555; } /*Adding a background color to the delete button */ .del-bg { background:#24b4de; color:#fff; font-size:26px; cursor: pointer; outline:none; border-bottom:3px solid #399cb9; } .del-bg:active { background:#24b4de; color:#fff; font-size:26px; cursor: pointer; outline:none; box-shadow: inset 4px 4px 4px #399cb9;
  • 8. } /*Adding a background color to the equals to button */ #eqn-bg { background:#17a928; color:#fff; font-size:26px; cursor: pointer; outline:none; border-bottom:3px solid #1f7a29; } #eqn-bg:active { background:#17a928; color:#fff; font-size:26px; cursor: pointer; outline:none; box-shadow: inset 4px 4px 4px #1f7a29; } @-webkit-keyframes bgChange { 0% { background:#24b4de; } 50% { background:#17a928; } 100% { background:#399cb9; } } JS: window.onload = function() { var current, screen, output,
  • 9. limit, zero, period, operator; screen = document.getElementById("result"); var elem = document.querySelectorAll(".num"); var len = elem.length; for(var i = 0; i < len; i++ ) { elem[i].addEventListener("click",function() { num = this.value; output = screen.innerHTML +=num; limit = output.length; if(limit > 16 ) { alert("Sorry no more input is allowed"); } },false); } document.querySelector(".zero").addEventListener("click",function() { zero = this.value; if(screen.innerHTML === "") { output = screen.innerHTML = zero;
  • 10. } else if(screen.innerHTML === output) { output = screen.innerHTML +=zero; } },false); document.querySelector(".period").addEventListener("click",function() { period = this.value; if(screen.innerHTML === "") { output = screen.innerHTML = screen.innerHTML.concat("0."); } else if(screen.innerHTML === output) { screen.innerHTML = screen.innerHTML.concat("."); } },false); document.querySelector("#eqn-bg").addEventListener("click",function() { if(screen.innerHTML === output) { screen.innerHTML = eval(output); }
  • 11. else { screen.innerHTML = ""; } },false); document.querySelector("#delete").addEventListener("click",function() { screen.innerHTML = ""; },false); var elem1 = document.querySelectorAll(".operator"); var len1 = elem1.length; for(var i = 0; i < len1; i++ ) { elem1[i].addEventListener("click",function() { operator = this.value; if(screen.innerHTML === "") { screen.innerHTML = screen.innerHTML.concat(""); } else if(output) { screen.innerHTML = output.concat(operator); } },false);
  • 12. } }