<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.stephanschlegel.de/index.php?action=history&amp;feed=atom&amp;title=Jquery-parallax</id>
	<title>Jquery-parallax - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.stephanschlegel.de/index.php?action=history&amp;feed=atom&amp;title=Jquery-parallax"/>
	<link rel="alternate" type="text/html" href="https://wiki.stephanschlegel.de/index.php?title=Jquery-parallax&amp;action=history"/>
	<updated>2026-05-06T20:48:11Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Wikizone</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.stephanschlegel.de/index.php?title=Jquery-parallax&amp;diff=22312&amp;oldid=prev</id>
		<title>37.49.32.84: Die Seite wurde neu angelegt: „== Anwendung ==  parallax(xpos,speed,outerHeight)  //xpos = Background-Position in x Richtung 50% für mittig  // speed 0 = keine Bewegung des Hintergrunds  &lt;s…“</title>
		<link rel="alternate" type="text/html" href="https://wiki.stephanschlegel.de/index.php?title=Jquery-parallax&amp;diff=22312&amp;oldid=prev"/>
		<updated>2017-05-15T15:26:20Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „== Anwendung ==  parallax(xpos,speed,outerHeight)  //xpos = Background-Position in x Richtung 50% für mittig  // speed 0 = keine Bewegung des Hintergrunds  &amp;lt;s…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Anwendung ==&lt;br /&gt;
 parallax(xpos,speed,outerHeight)&lt;br /&gt;
 //xpos = Background-Position in x Richtung 50% für mittig&lt;br /&gt;
 // speed 0 = keine Bewegung des Hintergrunds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
$(document).ready(function(){&lt;br /&gt;
  $(&amp;#039;.parallax&amp;#039;).parallax(&amp;quot;50%&amp;quot;, 0.3);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==jquery-parallax.js==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
Plugin: jQuery Parallax&lt;br /&gt;
Version 1.1.3&lt;br /&gt;
Author: Ian Lunn&lt;br /&gt;
Twitter: @IanLunn&lt;br /&gt;
Author URL: http://www.ianlunn.co.uk/&lt;br /&gt;
Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/&lt;br /&gt;
&lt;br /&gt;
Dual licensed under the MIT and GPL licenses:&lt;br /&gt;
http://www.opensource.org/licenses/mit-license.php&lt;br /&gt;
http://www.gnu.org/licenses/gpl.html&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
(function( $ ){&lt;br /&gt;
	var $window = $(window);&lt;br /&gt;
	var windowHeight = $window.height();&lt;br /&gt;
&lt;br /&gt;
	$window.resize(function () {&lt;br /&gt;
		windowHeight = $window.height();&lt;br /&gt;
	});&lt;br /&gt;
&lt;br /&gt;
	$.fn.parallax = function(xpos, speedFactor, outerHeight) {&lt;br /&gt;
		var $this = $(this);&lt;br /&gt;
		var getHeight;&lt;br /&gt;
		var firstTop;&lt;br /&gt;
		var paddingTop = 0;&lt;br /&gt;
		&lt;br /&gt;
		//get the starting position of each element to have parallax applied to it		&lt;br /&gt;
		$this.each(function(){&lt;br /&gt;
		    firstTop = $this.offset().top;&lt;br /&gt;
		});&lt;br /&gt;
&lt;br /&gt;
		if (outerHeight) {&lt;br /&gt;
			getHeight = function(jqo) {&lt;br /&gt;
				return jqo.outerHeight(true);&lt;br /&gt;
			};&lt;br /&gt;
		} else {&lt;br /&gt;
			getHeight = function(jqo) {&lt;br /&gt;
				return jqo.height();&lt;br /&gt;
			};&lt;br /&gt;
		}&lt;br /&gt;
			&lt;br /&gt;
		// setup defaults if arguments aren&amp;#039;t specified&lt;br /&gt;
		if (arguments.length &amp;lt; 1 || xpos === null) xpos = &amp;quot;50%&amp;quot;;&lt;br /&gt;
		if (arguments.length &amp;lt; 2 || speedFactor === null) speedFactor = 0.1;&lt;br /&gt;
		if (arguments.length &amp;lt; 3 || outerHeight === null) outerHeight = true;&lt;br /&gt;
		&lt;br /&gt;
		// function to be called whenever the window is scrolled or resized&lt;br /&gt;
		function update(){&lt;br /&gt;
			var pos = $window.scrollTop();				&lt;br /&gt;
&lt;br /&gt;
			$this.each(function(){&lt;br /&gt;
				var $element = $(this);&lt;br /&gt;
				var top = $element.offset().top;&lt;br /&gt;
				var height = getHeight($element);&lt;br /&gt;
&lt;br /&gt;
				// Check if totally above or totally below viewport&lt;br /&gt;
				if (top + height &amp;lt; pos || top &amp;gt; pos + windowHeight) {&lt;br /&gt;
					return;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				$this.css(&amp;#039;backgroundPosition&amp;#039;, xpos + &amp;quot; &amp;quot; + Math.round((firstTop - pos) * speedFactor) + &amp;quot;px&amp;quot;);&lt;br /&gt;
			});&lt;br /&gt;
		}		&lt;br /&gt;
&lt;br /&gt;
		$window.bind(&amp;#039;scroll&amp;#039;, update).resize(update);&lt;br /&gt;
		update();&lt;br /&gt;
	};&lt;br /&gt;
})(jQuery);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>37.49.32.84</name></author>
	</entry>
</feed>