J $ (window) .scroll (function (event) {
var y = j $ (this) .scrollTop ();
if (($ j (window) .scrollTop () & gt; $ j (‘. ls-articoloTesto’). height ()) & amp; & amp; ($ j (window) .scrollTop () & gt; 800)) {
if ($ j (“# sh_socialized_bottom”). css (‘display’) == ‘none’) {
J $ (“# sh_socialized_bottom”). Css (‘display’, ‘block’);
$ J (“# sh_socialized_bottom”). Html ($ j (“# sh_socialized”). Html ());
}
} Else {
J $ (“# sh_socialized_bottom”). Css (‘display’, ‘none’);
J $ (“# sh_socialized_bottom”). Html (”);
}
if (device.tablet () || device.mobile ()) {
return;
}
//
// Management of the top header
//
if (y & gt; 0) {
if (j $ (window) .scrollTop () & gt; j = $ (‘# page_header’). offset (). top) {
//
// Top header fixed
//
if (if! = 1) {
If = 1;
$ J (‘. Ls-topBannerSection’). AddClass (‘fixed’);
$ J (‘. Ls-topBannerSection’). AddClass (‘fixedTopHeader’);
J $ (‘# afterTopBanner’). Css (‘display’, ‘block’);
topBannerHeight j = $ (‘. ls-topBannerSection’). height () + j $ (‘. ls-boxUltimiArticoliLista’). height ();
// Console.log (‘Case:’ + event);
}
if (j $ (window) .scrollTop () (j $ (‘# getFixed’). offset (). top – $ j (‘. ls-topBannerSection’). height ())) {
//
// Management box recent articles
//
if (if! = 3) {
case = 3;
J $ (‘# afterUltimiArticoli’). Css (‘display’, ‘block’);
J $ (‘# getFixed’). AddClass (‘fixed’);
J $ (‘# getFixed’). AddClass (‘fixedTopArticoli’);
// J $ (‘. FixedTopArticoli’). Css (‘top’, topbannerSectionHeight + ‘px’);
// AfterUltimiArticoliTop j = $ (‘# getFixed’). Offset (). Top + j $ (‘# getFixed’). Height () – $ j (‘. Ls-topBannerSection’). Height ();
// Console.log (‘Case:’ + event);
}
} Else {
}
//
// Management of related articles in column 2
//
if (j $ (window) .scrollTop () & gt; j $ (‘. ls-articoloTesto’). height ()) {
if ($ j (“# containerArtCorr”). css (‘top’) == ’0px’) {
if ($ j (“# containerArtCorr”). css (‘display’) == ‘block’) {
postop var j = $ (‘# ad_frame2′). offset (). top – $ j (‘. ls-column2′). offset (). top + 250;
var posBottom postop = + j $ (“# containerArtCorr”). height ();
if ($ j (‘# ed_Related_Box’). offset (). top & gt; posBottom) {
J $ (“# containerArtCorr”). Css (‘display’, ‘none’);
J $ (“# containerArtCorr”). Css (‘position’, ‘relative’);
J $ (“# containerArtCorr”). Css (‘top’, postop + ‘px’);
$ J (“. Ls-column2″). Height ($ j (‘. Ls-column1′). Height ());
J $ (“# containerArtCorr”). FadeIn (600);
}
}
}
} Else {
J $ (“# containerArtCorr”). Css (‘top’, ’0px’);
}
} Else {
if (if! = 4) {
event = 4;
J $ (‘# afterTopBanner’). Css (‘display’, ‘none’);
J $ (‘# afterUltimiArticoli’). Css (‘display’, ‘none’);
$ J (‘. Ls-colonneArticolo’). Css (‘position’, ‘static’);
$ J (‘. Ls-colonneArticolo’). Css (‘top’, ’0px’);
$ J (‘. Ls-topBannerSection’). RemoveClass (‘fixed’);
$ J (‘. Ls-topBannerSection’). RemoveClass (‘fixedTopHeader’);
$ J (‘. Ls-spinster’). Css (‘position’, ‘static’);
$ J (‘. Ls-spinster’). Css (‘top’, ’0px’);
J $ (‘# getFixed’). RemoveClass (‘fixed’);
J $ (‘# getFixed’). RemoveClass (‘fixedTopArticoli’);
// Console.log (‘Case:’ + event);
}
}
});
});
// ———————————————— -
//
// Management of the box past articles in opening
//
// ———————————————— -
// Store the open / close status of the box to avoid
// Handle the same event in the scroll
boxOpened var = false;
// Store if the box was New hotel opened or closed
// Manually to not change the state
// In automatic mode during the scroll
boxManual var = false;
$ J (‘. Arrow_down_big’). Click (function () {
// I open the box
boxManual = true;
ultimiArticoliBox (‘open’);
});
$ J (‘. Arrow_up_big’). Click (function () {
// I close the box
boxManual = true;
ultimiArticoliBox (‘close’);
});
ultimiArticoliBox function (action) {
var speed1 = 300;
speed2 var = 500;
if ((action == ‘open’) & amp; & amp; (boxOpened == false)) {
var cssProp;
$ J (‘. Arrow_up_big’). Css (“display”, “block”);
$ J (‘. Arrow_down_big’). Css (“display”, “none”);
cssProp = {height: ’180px’};
$ J (“. Ls-new-leaf-.LS boxUltimiArticoli-top-.LS boxcontent-body”). Animate (cssProp, speed2);
cssProp = {top: ’20px’};
// J $ (‘# getFixed #boxUltimoArticolo .LS-boxUltimoArticolo-info’). Animate (cssProp, speed2);
J $ (‘# getFixed #boxUltimoArticolo .LS-box-text’). Animate (cssProp, speed2);
cssProp = {top: ’0px’};
// J $ (‘# getFixed #boxUltimoArticolo .imgUltimoArticolo’). Animate (cssProp, speed2);
J $ (‘# getFixed #boxUltimoArticolo .LS-box-image’). Animate (cssProp, speed2);
cssProp = {height: ’179px’};
$ J (“. Ls-new-leaf-.LS boxUltimiArticoli-top-.LS boxUltimiArticoliLista”). Animate (cssProp, speed2,
function ()
{
var height = j $ (‘# getFixed’). height ()
cssProp = {height: + height + ‘px’};
J $ (‘# afterUltimiArticoli’). Animate (cssProp, speed1);
}
);
boxOpened = true;
}
if ((action == ‘close’) & amp; & amp; (boxOpened == true)) {
var cssProp;
$ J (‘. Arrow_up_big’). Css (“display”, “none”);
$ J (‘. Arrow_down_big’). Css (“display”, “block”);
cssProp = {top: ‘-130px’};
// J $ (‘# getFixed #boxUltimoArticolo .imgUltimoArticolo’). Css (‘position’, ‘relative’);
// J $ (‘# getFixed #boxUltimoArticolo .imgUltimoArticolo’). Animate (cssProp, speed2);
J $ (‘# getFixed #boxUltimoArticolo .LS-box-image’). Css (‘position’, ‘relative’);
J $ (‘# getFixed #boxUltimoArticolo .LS-box-image’). Animate (cssProp, speed2);
cssProp = {top: ‘-100px’};
// J $ (‘# getFixed #boxUltimoArticolo .LS-boxUltimoArticolo-info’). Css (‘position’, ‘relative’);
// J $ (‘# getFixed #boxUltimoArticolo .LS-boxUltimoArticolo-info’). Animate (cssProp, speed2);
J $ (‘# getFixed #boxUltimoArticolo .LS-box-text’). Css (‘position’, ‘relative’);
J $ (‘# getFixed #boxUltimoArticolo .LS-box-text’). Animate (cssProp, speed2);
cssProp = {height: ’59px’};
$ J (“. Ls-new-leaf-.LS boxUltimiArticoli-top-.LS boxUltimiArticoliLista”). Animate (cssProp, speed2);
cssProp = {height: ’60px’};
$ J (“. Ls-new-leaf-.LS boxUltimiArticoli-top-.LS boxcontent-body”). Animate (cssProp, speed2,
function ()
{
var height = j $ (‘# getFixed’). height ()
cssProp = {height: + height + ‘px’};
J $ (‘# afterUltimiArticoli’). Animate (cssProp, speed1);
}
);
J $ (‘# afterUltimiArticoli’). Height (j $ (‘# getFixed’). Height ());
boxOpened = false;
}
}
// ———————————————— -
//
// Management related articles
//
// ———————————————— -
var speed = 300;
var valueArt = 0;
var topValueArt = 0;
var minValueArt = 0;
numArticoli var j = $ (“# containerArtCorr .LS-boxcontent-body-view .LS-boxUltimoArticolo”). length;
currArticolo var = 1;
// ———————————————— -
// Click Arrow pointing down
//
// ———————————————— -
J $ (“# containerArtCorr #articoliCorrScrollDown”). Click (function () {
valueArt = valueArt – $ j (j $ (“# containerArtCorr .LS-boxUltimoArticolo”). get (currArticolo – 1)). outerHeight ();
cssProp var = {top: + valueArt + ‘px’};
if ($ j (“# containerArtCorr #articoliCorrScrollDown”). hasClass (‘. active’) == false)
return;
currArticolo ++;
J $ (“# containerArtCorr .LS-boxcontent .LS-box-items-related .LS-boxcontent-body .LS-boxcontent-body-view”). Animate (cssProp, speed,
function () {
J $ (“# containerArtCorr #articoliCorrScrollUp”). Attr (‘src’, ‘/ form / new-leaf / img / arrow_up.png’);
J $ (“# containerArtCorr #articoliCorrScrollUp”). AddClass (‘. Active’);
heightContainer var j = $ (“# containerArtCorr .LS-boxcontent .LS-box-items-related .LS-boxcontent-body .LS-boxcontent-body-view”). height ();
if (currArticolo & gt; (numArticoli – 1)) {
J $ (“# containerArtCorr #articoliCorrScrollDown”). Attr (‘src’, ‘/ common / img / arrow_down_disabled.png’);
J $ (“# containerArtCorr #articoliCorrScrollDown”). RemoveClass (‘. Active’);
} Else {
J $ (“# containerArtCorr #articoliCorrScrollDown”). Attr (‘src’, ‘/ common / img / arrow_down.png’);
J $ (“# containerArtCorr #articoliCorrScrollDown”). AddClass (‘. Active’);
}
}
);
});
// ———————————————— -
// Arrow upwards Click
//
// ———————————————— -
J $ (“# containerArtCorr #articoliCorrScrollUp”). Click (function () {
valueArt = valueArt + $ j (j $ (“# containerArtCorr .LS-boxUltimoArticolo”). get (currArticolo – 2)). outerHeight ();
cssProp var = {top: + valueArt + ‘px’};
if ($ j (“# containerArtCorr #articoliCorrScrollUp”). hasClass (‘. active’) == false)
return;
currArticolo–;
J $ (“# containerArtCorr .LS-boxcontent .LS-box-items-related .LS-boxcontent-body .LS-boxcontent-body-view”). Animate (cssProp, speed,
function () {
J $ (“# containerArtCorr #articoliCorrScrollDown”). Attr (‘src’, ‘/ form / new-leaf / img / arrow_down.png’);
J $ (“# containerArtCorr #articoliCorrScrollDown”). AddClass (‘. Active’);
if (numArticoli

