Linktipp: Howto: JQuery jcarousel Pause bei Hover
So einfach kann jcarousel um eine Hover-Pause ergänzt werden!
Großartiger Code-Schnippsel!
Hier noch einmal kopiert, falls die URL irgendwann nicht mehr erreichbar ist:
- jQuery(document).ready(function() {
- jQuery('#mycarousel').jcarousel({
- scroll: 1,
- auto: 2,
- wrap: 'last',
- initCallback: function(jc, state) {
- if (state == 'init') {
- /* Pause carousel scrolling when a user mouses overs
- an item and restart the scrolling when they mouse out.
- * Written by cormac at finisco dot com 19/2/2009
- based on work by Jeremy Mikola:
- * <a href="http://groups.google.com/group/jquery-en/browse_thread/thread/f550b94...<br />
- " title="http://groups.google.com/group/jquery-en/browse_thread/thread/f550b94...<br />
- ">http://groups.google.com/group/jquery-en/browse_thread/thread/f550b94...<br />
- </a> */
- jc.startAutoOrig = jc.startAuto;
- jc.startAuto = function() {
- if (!jc.paused) {
- jc.startAutoOrig();
- }
- }
- jc.pause = function() {
- jc.paused = true;
- jc.stopAuto();
- };
- jc.play = function() {
- jc.paused = false;
- jc.startAuto();
- };
- $('li.jcarousel-item').mouseover(function() {
- jc.pause();
- });
- $('li.jcarousel-item').mouseout(function() {
- jc.play();
- });
- }
- jc.play();
- }
- });
- });
Julian Pustkuchen ist passionierter Software- & Webentwickler mit den Schwerpunkten Softwaredesign, Objektorientierung, Ablaufoptimierung und Usability bei webks. Ein weiterer Schwerpunkt ist die Entwicklung im CMS Drupal.
Er besitzt einen Abschluss als B.Sc. Wirtschaftsinformatik (dual) und studiert derzeit für seinen Abschluss als Master of Science Wirtschaftsinformatik.
Entwickelt Julian gerade keine Software, fährt er Ski, Mountainbike, spielt Badminton, segelt oder verbringt Zeit mit Freunden.
Dieser Blog dient als sein "öffentlicher Notizblo(ck/g)".
Neueste Blogeinträge
-
08.05.2012 - 17:41
-
03.05.2012 - 18:53
-
28.03.2012 - 10:28
Tags in Blogeintrag - Kategorie
Webbasierte Lösungen? Machen wir!
webks: websolutions kept simple
http://www.webks.de






Comments
Post new comment