Lekcja 1 - ćwiczenia i zadanie
This commit is contained in:
1 parent
1c1d616161
commit
28836af2ee
9 files changed
+9946
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>jQuery Lekcja 1</title>
|
||||
<script src="lib/jquery.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
let size = 100;
|
||||
|
||||
$("#b1").on("click", function() {
|
||||
let enlarge = confirm("Shall I enlarge, sir?")
|
||||
size = enlarge ? size*2 : size/3
|
||||
$("#d1").css("width", `${size}px`)
|
||||
$("#d1").css("height", `${size}px`)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
#d1 {
|
||||
background-color: green;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<button id="b1">Zmiana rozmiaru</button><br>
|
||||
<div id="d1"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user