/*JQuery*/
$('#head').click(function(){
alert('test text');
});
$('.text').click(function(){
var x = $(this).clone();
$('#result').append(x);
});
/*javascript*/
/*обьекты*/
var hidetext = document.getElementById('hd')
var showtext = document.getElementById('shw')
/*действия*/
function click1(){
var ht = $('#head');
ht.fadeOut(3000);
var tt = $('.text');
tt.fadeOut(3000);
}
function click2(){
var ht = $('#head');
ht.fadeIn(3000);
var tt = $('.text');
tt.fadeIn(3000);
}
/*события*/
hidetext.onclick = click1;
showtext.onclick = click2;
/* Калькулятор*/
var operand = null;
var operation = null;
function prnt(c) {
document.getElementById("display").innerHTML = document.getElementById("display").innerHTML + c;
}
function calc(o) {
operand = document.getElementById("display").innerHTML;
operation = o;
document.getElementById("display").innerHTML = "";
}
function result() {
if (operand === null || operation === null || document.getElementById("display").innerHTML === "") {
alert("Нечего считать!");
return;
}
other_operand = document.getElementById("display").innerHTML - 0;
r = 0;
switch (operation) {
case "addition":
r = +operand + other_operand;
break;
case "subtraction":
r = operand - other_operand;
break;
case "multiplication":
r = operand * other_operand;
break;
case "division":
r = operand / other_operand;
break;
}
document.getElementById("display").innerHTML = r;
}
function reset() {
document.getElementById("display").innerHTML = "";
operand = null;
operation = null;
}