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,46 @@
|
||||
<!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;
|
||||
let counter = 0;
|
||||
|
||||
$("#d1").on("mouseover", function () {
|
||||
counter++
|
||||
$("#d1").text(counter)
|
||||
if(counter == 5) {
|
||||
size *= 2
|
||||
$("#d1").css("width", `${size}px`)
|
||||
$("#d1").css("height", `${size}px`)
|
||||
counter = 0
|
||||
}
|
||||
})
|
||||
$("#d1").on("mouseleave", function () {
|
||||
$("#d1").text("")
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
body {
|
||||
background-color: skyblue;
|
||||
}
|
||||
#d1 {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: azure;
|
||||
color: seagreen;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="d1"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user