Support Forums

Support Online : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Sp left new class on scroll

Featured Lock Resolved
Hi,
Can you help me please?

I want sp left on scroll to have a class like header sticky,
I added this code but nothing.

is ok how i made ?


// Sticky Left
if ($('body').hasClass('sticky-left')) {
var left = $('#sp-left');

if($('#sp-left').length) {
var leftHeight = left.outerHeight();
var stickyLeftTop = left.offset().top;
var stickyLeft = function () {
var scrollTop = $(window).scrollTop();
if (scrollTop > stickyLeftTop) {
left.addClass('left-sticky');
} else {
if (left.hasClass('left-sticky')) {
left.removeClass('left-sticky');
}
}
};
stickyLeft();
$(window).scroll(function () {
stickyLeft();
});
}

if ($('body').hasClass('layout-boxed')) {
var windowWidth = left.parent().outerWidth();
left.css({"max-width": windowWidth, "left": "auto"});
}
}

1 Answers

Ionut

More than a month ago #Permalink
Fixed


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Leaderboard (30 days)

Sifat

Sifat

Total Accepted Answers: 132
Paul Frankowski

Paul Frankowski

Total Accepted Answers: 122
Toufiq

Toufiq

Total Accepted Answers: 64
Pavel

Pavel

Total Accepted Answers: 5
Peter Atkin

Peter Atkin

Total Accepted Answers: 2

100+

Templates

200,000+

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us