2

I am trying to implement this piece of jQuery code. All other HTML and CSS are working fine, however this jQuery code is not working.

How do I implement this piece of code into my Laravel Blade file?

@push('js')
<script>
    $(window).load(function() {
        alert("sabdfjksbfjdsbds");
        var pageSize = 1300;
        var currrentPageSpace = pageSize;
        $(".section-wrapper").each(function() {

            var sectionPosition = $(this).position().top;
            var sectionHeight = $(this).outerHeight(true);

            var availabePageSpace = currrentPageSpace - sectionPosition;
            if (sectionHeight < availablePageSpace) {
                $(this).css("margin-top", availabePageSpace+"px"); 
                currentPageSpace += pageSize; //Now we are on new page and its available space is adjusted
            }
        });
    });
</script>
@endpush
jdyuen
  • 9
  • 1
Shuvro Akash
  • 540
  • 5
  • 17

0 Answers0