$(function() { $('.scroll-pane').jScrollPane({showArrows: true}); }); $(document).ready(function(){ function big_scroller_transition(direction) { $(".big_scroller_slide_text").fadeOut('fast'); var source_0 = $(".big_scroller_slide_0").html(); var source_1 = $(".big_scroller_slide_1").html(); var source_2 = $(".big_scroller_slide_2").html(); var source_3 = $(".big_scroller_slide_3").html(); $("#big_scroller_nav a, #big_scroller_slider .big_scroller_slide a, #big_scroller_arrow_left, #big_scroller_arrow_right").addClass("no-click"); if (direction == 'left') { var move_left = '+=941'; } else if (direction == 'right') { var move_left = '-=941'; } $("#big_scroller_slider, #big_scroller_active_slider").animate({ left: move_left }, 600, function(){ // reorder slides if (direction=='right') { $(".big_scroller_slide_0").html(source_1); $(".big_scroller_slide_1").html(source_2); $(".big_scroller_slide_2").html(source_3); $(".big_scroller_slide_3").html(source_0); } else if (direction=='left') { $(".big_scroller_slide_3").html(source_2); $(".big_scroller_slide_2").html(source_1); $(".big_scroller_slide_1").html(source_0); $(".big_scroller_slide_0").html(source_3); } // move #big_scroller_active_slider to left:-941px and #big_scroller_slider to left:-1884px; $("#big_scroller_active_slider").css("left","-941px"); $("#big_scroller_slider").css("left","-1393px"); $("#big_scroller_nav a, #big_scroller_slider .big_scroller_slide a, #big_scroller_arrow_left, #big_scroller_arrow_right").removeClass("no-click"); $(".big_scroller_slide_text").fadeIn('slow'); }); } $("#big_scroller_nav a, #big_scroller_slider .big_scroller_slide, #big_scroller_arrow_left, #big_scroller_arrow_right").click(function(){ var direction; if ($(this).hasClass("no-click")) { return false; } else { if ($(this).hasClass("big_scroller_slide_r1") || $(this).attr("id") == "big_scroller_arrow_right") { direction = 'right'; } else if ($(this).hasClass("big_scroller_slide_l1") || $(this).attr("id") == "big_scroller_arrow_left") { direction = 'left'; } else { direction = $(this).attr("id").replace(/big_scroller_nav_/,''); } big_scroller_transition(direction); clearInterval(intervalID); return false; clearInterval(intervalID); } }); // start big scroller animation, and timing if ($("div").hasClass("home")) { intervalID = window.setInterval(function(){ big_scroller_transition("right"); }, 5000); } // position big scrolling images on homepage and page dropshadow function reposition_scroller() { var content_width = 941; var container_width = 1920; var window_width = $(window).width(); var window_height = $(window).height(); var body_height = $("body").height(); var left_position = (window_width - container_width)/2; $("#big_scroller_container").css("left",left_position+"px"); // enable banner images $(".big_scroller_slide img").each(function(){ var real_img = $(this).attr("id"); $(this).attr("src",real_img); }); $("#big_scroller_active_slider").css("display","block"); $("#big_scroller_slider").css("display","block"); left_position = (window_width - content_width)/2; var arrow_width = (window_width-content_width)/2; $("#big_scroller_arrows a").css("width",120+"px"); } reposition_scroller(); $(window).resize(function(){ reposition_scroller(); }); });