Anchor Cycler / Dropdown to import school class data periodically

前端 未结 4 1758
清酒与你
清酒与你 2021-02-05 13:48

SO,

I\'ve been working on some html/javascript/css recently to create an online table for my students to view details, scores and various bits of information but I\'ve

4条回答
  •  野性不改
    2021-02-05 14:17

    1) You have to realize that you're not scrolling the page like you would do that with your scroll on a mouse. You're actually manipulating margin-left and this behaviour causes that you give it very large values. Then, it looks like you have told. There's a huge space between table and end of your screen. To solve it, you have to add an if statement that is going to check if you're trying to increase margin-left too much.

     $("a.def").click(function() {
        $("#gradient-style").each(function(){
            var margin =$(this).css("margin-left");
    
            if(margin > -204)
                 $(this).animate({"margin-left":"+=204px"},200);
            else
                 $(this).animate({"margin-left":"+=" +(-margin)},200);
        });
    });
    

    5) You could use localStorage variable which is built-in JavaScript feature. You can simply define any variable and use it over session. Here's example:

     localStorage.numberOfRow =1;
     console.log(localStorage.numberOfRow);     //1
    

提交回复
热议问题