Support Forums

Support Offline : 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

One week 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)

Paul Frankowski

Paul Frankowski

Total Accepted Answers: 217
Sifat

Sifat

Total Accepted Answers: 133
Toufiq

Toufiq

Total Accepted Answers: 44
Archange Consulting

Archange Consulting

Total Accepted Answers: 2
stq74

stq74

Total Accepted Answers: 1

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