JavaScript update

This commit is contained in:
andy
2020-03-24 13:08:14 +01:00
parent 3f0d3b7424
commit 789699298c
7 changed files with 232 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
// Ist jQery bereit?.
$( document ).ready(function() {
//Konsolen-Test
console.log( "jQuery ist bereit!" );
//Ausblenden / Einblenden
$("#aus").click(function(){
$(".box").fadeOut( 1500 );
});
$("#ein").click(function(){
$(".box").show();
});
//Animieren
$("#anim").click(function(){
$(".box").animate({
marginLeft: "150px",
opacity: 0.5
});
});
});
+2
View File
File diff suppressed because one or more lines are too long
+14
View File
@@ -0,0 +1,14 @@
var greenbox = document.querySelector('.box');
document.addEventListener('click', function (event) {
if (event.target.matches('#ein')) {
greenbox.removeAttribute('hidden');
greenbox.classList.add('fadeInDown');
}
if (event.target.matches('#aus')) {
greenbox.setAttribute('hidden', 'true');
greenbox.classList.remove('fadeInDown');
}
}, false);