104 lines
4.3 KiB
HTML
104 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="description" content="jQuery in Webseiten">
|
|
<title>JavaScript & jQery</title>
|
|
<link rel="stylesheet" href="../css/reset.css">
|
|
<link rel="stylesheet" href="../css/code.css">
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
<link rel="stylesheet" href="../css/flex.css">
|
|
<link rel="stylesheet" href="../css/featherlight.min.css">
|
|
<link rel="stylesheet" href="../css/featherlight.gallery.min.css">
|
|
<style>
|
|
.gallery img{
|
|
display: inline-block;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<header>
|
|
<div class="wrapper">
|
|
<a href="../index.html"><img src="../img/logo.svg" alt="Mein logo" title="Der Titel meines Bildes"></a>
|
|
<nav role="navigation">
|
|
<ul>
|
|
<li><a href="float.html">Float</a></li>
|
|
<li><a href="position.html">Position</a></li>
|
|
<li><a href="flexbox.html">Flexbox</a></li>
|
|
<li><a href="grid.html">Grid</a></li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</header>
|
|
|
|
<main role="main" class="wrapper">
|
|
<h1>JavaScript & jQuery-Plugins</h1>
|
|
<article>
|
|
<h2>jQery Plugin integrieren</h2>
|
|
<p>Die JavaScript-Bibliothek jQuery stellt eigentlich nur Grundfunktionen bereit. Für speziellere Aufgaben gibt es Plugins, das heißt zusätzliche JavaScript-Dateien.</p>
|
|
<p>Für dieses Beispiel einer (lightbox) Galerie habe ich <a href="https://noelboss.github.io/featherlight/"> https://noelboss.github.io/featherlight/</a>ausgewählt.</p>
|
|
|
|
</div>
|
|
</article>
|
|
<article>
|
|
<h2>Einbinden von jQuery und Plugins</h2>
|
|
<pre class="line-numbers language-html">
|
|
<code class="language-html"></footer>
|
|
<script src="../js/jquery-3.4.1.min.js"></script>
|
|
<script src="../js/jquery.detect_swipe.js"></script> /* Swipe Funktion Smartphone */
|
|
<script src="../js/featherlight.min.js"></script>
|
|
<script src="../js/featherlight.gallery.min.js"></script> /* Galerie Funktion */
|
|
</body>
|
|
</code>
|
|
</pre>
|
|
</article>
|
|
<article>
|
|
<h2>Galerie mit Funktionen zum öffnen und blättern von Bildern</h2>
|
|
<a class="gallery box" href="../img/gallery/1.jpg"><img src="http://via.placeholder.com/150" alt=""></a>
|
|
<a class="gallery box" href="../img/gallery/2.jpg"><img src="http://via.placeholder.com/150" alt=""></a>
|
|
<a class="gallery box" href="../img/gallery/3.jpg"><img src="http://via.placeholder.com/150" alt=""></a>
|
|
<a class="gallery box" href="../img/gallery/4.jpg"><img src="http://via.placeholder.com/150" alt=""></a>
|
|
</div>
|
|
</article>
|
|
<article>
|
|
<h2>Eigene Konfiguration des jQuery Plugins</h2>
|
|
<pre class="line-numbers language-js">
|
|
<code class="language-js">$('a.gallery').featherlightGallery({
|
|
previousIcon: '&#9664;', /* Code that is used as previous icon */
|
|
nextIcon: '&#9654;', /* Code that is used as next icon */
|
|
galleryFadeIn: 100, /* fadeIn speed when slide is loaded */
|
|
galleryFadeOut: 300 /* fadeOut speed before slide is loaded */
|
|
});
|
|
</code>
|
|
</pre>
|
|
</article>
|
|
|
|
|
|
</main>
|
|
|
|
<footer>
|
|
<div class="wrapper">
|
|
<p><a title="Link zu Download" href="https://git.perin.work/andy/webdev">Download</a></p>
|
|
</div>
|
|
</footer>
|
|
<script src="../js/code.js"></script>
|
|
<script src="../js/jquery-3.4.1.min.js"></script>
|
|
<script src="../js/jQuery.js"></script>
|
|
<script src="../js/featherlight.min.js"></script>
|
|
<script src="../js/featherlight.gallery.min.js"></script>
|
|
|
|
<script>/* Eigene Konfiguration der Galerie */
|
|
$('a.gallery').featherlightGallery({
|
|
previousIcon: '◀', /* Code that is used as previous icon */
|
|
nextIcon: '▶', /* Code that is used as next icon */
|
|
galleryFadeIn: 100, /* fadeIn speed when slide is loaded */
|
|
galleryFadeOut: 300 /* fadeOut speed before slide is loaded */
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html> |