Horje
mobile view next and previous button Code Example
mobile view next and previous button
$(document).ready(function () {
    var divs = $('.mydivs>div');
    var now = 0; // currently shown div
    divs.hide().first().show();
    $("button[name=next]").click(function (e) {
        divs.eq(now).hide();
        now = (now + 1 < divs.length) ? now + 1 : 0;
        divs.eq(now).show(); // show next
    });
    $("button[name=prev]").click(function (e) {
        divs.eq(now).hide();
        now = (now > 0) ? now - 1 : divs.length - 1;
        divs.eq(now).show(); // or .css('display','block');
        //console.log(divs.length, now);
    });
});

<div class="mydivs">
    <div>div 1</div>
    <div>div 2</div>
    <div>div 3</div>
    <div>div 4</div>
</div>




Java

Related
Get Subarray from Array Code Example Get Subarray from Array Code Example
JUnit5 @Test method whose data comes from dataForTestSearchString Code Example JUnit5 @Test method whose data comes from dataForTestSearchString Code Example
java feld erstellen Code Example java feld erstellen Code Example
calculate Standard Deviation in java Code Example calculate Standard Deviation in java Code Example
what is a producedure java Code Example what is a producedure java Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8