Expand on scroll to div ID
-
Hi guys,
first of all: thanks for that awesome plugin! Very useful and easy.
I asked myself if I could let the collapse-items expand when I scroll to a specifid div ID. I almost got it, the arrows change but the content doesn’t show. Does it even work?
As I had to use a roll-your-own method, I tried the following:
$(window).scroll(function() { var scroll = $(this).scrollTop(); var position = $('#profil').offset().top; if (scroll >= position) { $(".collapseomatic").addClass("colomat-close"); $(".collapseomatic_content").removeClass("force_content_collapse"); } else { $(".collapseomatic").removeClass("colomat-close"); $(".collapseomatic_content").addClass("force_content_collapse"); } });
Thanks in advance
https://www.ads-software.com/plugins/jquery-collapse-o-matic/
- The topic ‘Expand on scroll to div ID’ is closed to new replies.