Message from JavaScript talks

June 2017

— Please help me thanks in advance

— 

Here is my code:
$('.banner').scroll(function() {

            var currentScrollPosition = $(this).scrollTop();

            if (currentScrollPosition > lastScrollTop) {

                //scroll down

                elem.each(function() {

                    var elemtop = $(this).offset().top;

                    //var elemtop = $(window).height()/3;

                    var x = Math.abs(currentScrollPosition + elemtop);

                    $(this).css({

                        'opaciy': -(currentScrollPosition - elemtop) / 300,

                        'transform': 'scale(' + x / 500 + ') translateY(' + x / 1000 + '%)'

                    });

                    /*if (currentScrollPosition > elemtop) {

                        $(this).addClass('active');

                    }*/

                });

            } else {

                //scrollup

                elem.each(function() {

                    var elemtop = $(this).offset().top;

                    $(this).css({

                        'opaciy': -(currentScrollPosition - elemtop) / 1000,

                        'transform': 'scale(' + Math.abs(currentScrollPosition - elemtop) / 1000 + ')'

                    });

                    /*if (currentScrollPosition < elemtop) {

                        $(this).removeClass('active');

                    }*/

                });

                var elemtop = $(this).offset().top;

                if (elem.last() == elemtop) {

                    // $(this).css({'color','blue'});

                }

            }

            lastScrollTop = currentScrollPosition;

        });

— Cool

— Hello guys

— Can u guys help me?

— I am making a menu that fetched from JSON

— Well, its resulted as a success

— But i want to make when i click the menu, it will open a new page

— And in that page the data (from other json) will appear based on the menu that i click

— So e.g
this is my menu

1. Menu 1 -> Id 1
2. Menu 2 -> Id 2

this is my page
1. page 1 -> id 1 , menu_id : 1
2. page 2 -> id 2, menu_id : 2

how to make the page based on the menu? i am fail in this step

Message permanent page

— You can add event listeners on your menu, then do some json request and show it as page.

— Ex :
<button id="q">page 1</button>
<div id="page"></div>
<script>