Commit 9562ff6a authored by imac's avatar imac

[Bugfix]Redmine #721 : Scroll image cover

parent 8cdefe57
...@@ -581,19 +581,20 @@ $(items).each(function () { ...@@ -581,19 +581,20 @@ $(items).each(function () {
var refElement = $(currLink.attr("href")); var refElement = $(currLink.attr("href"));
//console.log(currLink); //console.log(currLink);
if (refElement.length && refElement.position().top - ( $(".main").outerHeight() / 2 - titleHeight - $(".footer").outerHeight() ) <= scrollPos && refElement.position().top + refElement.height() > scrollPos) { if (refElement.length && refElement.position().top - ( $(".main").outerHeight() / 2 - titleHeight - $(".footer").outerHeight() ) <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {
if ( timer ) clearTimeout(timer);
timer = setTimeout(function(){
$('.subcat a').removeClass("active"); $('.subcat a').removeClass("active");
currLink.addClass("active"); currLink.addClass("active");
if ($('nav ul ul').find('li.active')){ if ($('nav ul ul').find('li.active')){
$('nav ul li').removeClass('current').addClass('off'); $('nav ul li').removeClass('current').addClass('off');
parent = currLink.parent().parent().parent(); parent = currLink.parent().parent().parent();
parent.addClass('current').removeClass('off'); parent.addClass('current').removeClass('off');
if ( timer2 ) clearTimeout(timer2);
$('.phototheque .off .subcat').stop().slideUp(); timer2 = setTimeout(function(){
parent.find('ul').stop().slideDown(); $('.phototheque .off .subcat').stop().slideUp();
parent.find('ul').stop().slideDown();
}, 330);
} }
}, 330);
} }
else{ else{
currLink.removeClass("active"); currLink.removeClass("active");
...@@ -660,6 +661,7 @@ $(window).load( function() { ...@@ -660,6 +661,7 @@ $(window).load( function() {
}) })
});//END document load });//END document load
var timer; var timer;
var timer2;
$(window).scroll(function(e) { $(window).scroll(function(e) {
onScroll(e); onScroll(e);
var elem = $('.home-down-wrapper'); var elem = $('.home-down-wrapper');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment