Vuejs dynemically slider – Vuejs image slider component example – Vuejs Carousel Slider Components

An image slider is the quintessential simple quickly use case using vue.js.The HTML element is named image-slider custom, which means in our elements HTML we can simple use the HTML tag to end to insert all the data the slider or images anywhere we want display to show it

vue js range slider,vue slide,vue-awesome-swiper,vue js carousel,vue swipe,vue slider component,vue range slider,vue carousel,Vuejs slider carousel,Vuejs image slider directive,Vuejs image slider demo,Vuejs image slider with thumbnail,Vuejs image slider jsfiddle,Vuejs slideshow example,Vuejs image carousel,Vuejs content sliderhere simple currently using image carousel provided by bootstrap data which is working in this example.

READ :  Vue js Price-Time Range Slider Plugins

index.html

<div id="slider">
        <div id="text" class="textc"></div>
        <div class="box" id="cube">
        <div class='slide-image'> 
        <div id="image1_4" class='front face'>
            <p>This is front face</p>
            <img class="image-slide" src="https://infinityknow.com/dreams/4141/rock.jpg">
        </div>
        <div id="image2_4" class="right face">
            <p>This is right face</p>
            <img src="https://infinityknow.com/dreams/4141/grooves.jpg">
        </div>
        <div id="image3_4" class="back face">
            <p>This is back face</p>
        <img src="https://infinityknow.com/dreams/4141/arch.jpg">
        </div>
        <div id="image4_4" class="left face">
            <p>This is left face</p>
        <img src="https://infinityknow.com/dreams/4141/sunset.jpg">
        </div>

        </div>
            </div>
</div>
[php]

<h3>index.js</h3>
[php]

var livetxt = document.getElementById('livetxt');
var cube = document.getElementById('cube');
livetxt.innerHTML = "lllllll";
var myAngelrot = 0;

var left = $("#cube").position().left;
var right =  left + $("#image1_4").width();    
var top = $("#cube").position().top;
var bottom = top + $("#image1_4").height();

var maxTime = 1000,
    maxDistance = 50,

    target = $('.front, .right'),
    liveX = 0,
    livez = 0,
    lifeStartTime = 0,
    rotation = false,
    touch = "ontouchend" in document,
    startEvent = (touch) ? 'touchstart' : 'mousedown',
    moveEvent = (touch) ? 'touchmove' : 'mousemove',
    endEvent = (touch) ? 'touchend' : 'mouseup';



document.addEventListener(startEvent, onTouchStart);
document.addEventListener(moveEvent, onTouchMove);
document.addEventListener(endEvent, onTouchEnd);

function onTouchStart(e) {
        e.preventDefault();
    
    if (left){
           livetxt.innerHTML = "livetxt width present " + left;
    }else{
                  livetxt.innerHTML = "livetxt width NOT present" ;
    }
    lifeStartTime = e.timeStamp;
       
    liveX = (e && e.touches) ? e.touches[0].pageX : e.pageX;
    startY = (e && e.touches) ? e.touches[0].pageY : e.pageY;
    if (liveX > left && liveX  top && startY < bottom){
        rotation = true;
    }else{
        rotation = false;
    }
    
}

function onTouchMove(e) {
    e.preventDefault();
    var currentX = (e && e.touches) ? e.touches[0].pageX : e.pageX,
        // allow if movement  0) {
        currentDistance = Math.abs(currentX - liveX);
    } 

    if (rotation && lifeStartTime !== 0 && currentTime - lifeStartTime  maxDistance) {
        if (currentX  liveX) {
            myAngelrot = myAngelrot + 90;
            $("#cube").css("-webkit-transform", "rotateY(" + myAngelrot + "deg)");
            $("#cube").css("-moz-transform", "rotateY(" + myAngelrot + "deg)");
        }

        lifeStartTime = 0;
        liveX = 0;

    }

}

function onTouchEnd(e) {
    livetxt.innerHTML = "On";
    lifeStartTime = 0;
    liveX = 0;
}


Example

READ :  create Dynamic component and template loading with VueJS