$(document).ready(function () { function d() { $(this).parents("ul.list:first").find("a").removeClass("selected").end().end().addClass("selected") } function e(c) { c = $("#slider .navigation").find('a[href$="' + c.id + '"]').get(0); d.call(c) } var a = $("#slider .scroll-container > div"), b = $("#slider .scroll-container"); a.css({ "float": "left", position: "relative" }); b.css("width", a[0].offsetWidth * a.length); var f = $("#slider .scroll").css("overflow", "hidden"); f.before('<a class="prev-tip" href="#" />').after('<a class="next-tip" href="#" />'); $("#slider .navigation").find("a").click(d); window.location.hash ? e({ id: window.location.hash.substr(1) }) : $("ul.navigation a:first").click(); b = parseInt(b.css("paddingTop") || 0) * -1; a = { target: f, items: a, navigation: ".navigation a", prev: "a.prev-tip", next: "a.next-tip", axis: "xy", onAfter: e, offset: b, duration: 500, easing: "swing" }; $("#slider").serialScroll(a) });
