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

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 :  C# HashSet Tutorial with Examples

index.html

[php]

This is front face

This is right face

This is back face

This is left face

[php]

index.js

[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;

READ :  Vue js Price-Time Range Slider Plugins

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;
}

[/php]

Example

Leave a Comment