webdev/html/jquery_plugin.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">&lt;/footer&gt;
&lt;script src=&quot;../js/jquery-3.4.1.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;../js/jquery.detect_swipe.js&quot;&gt;&lt;/script&gt; /* Swipe Funktion Smartphone */
&lt;script src=&quot;../js/featherlight.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;../js/featherlight.gallery.min.js&quot;&gt;&lt;/script&gt; /* Galerie Funktion */
&lt;/body&gt;
</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">$(&apos;a.gallery&apos;).featherlightGallery({
previousIcon: &apos;&amp;#9664;&apos;, /* Code that is used as previous icon */
nextIcon: &apos;&amp;#9654;&apos;, /* 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: '&#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 */
});
</script>
</body>
</html>