Created
December 16, 2015 15:39
-
-
Save edinsoncs/2c53e26f674f74b34f3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slider() { | |
var next = $(".itemSlider--Next"); | |
var previus = $(".itemSlider--Previus"); | |
$(next).click(function(){ | |
//Active previus | |
setTimeout(function(){ | |
$(".itemSlider--Previus").show('slow'); | |
var itemSlide = $(".itemSlider--Show").animate({ | |
'margin-left': '+=-343px' | |
}, 800, function(){ | |
//alert('hola'); | |
}); | |
var s = $(itemSlide)[0].offsetLeft; | |
console.log(s); | |
if(s == -267 || s == -343 || s >= 686) { | |
$(".itemSlider--Next").hide('slow'); | |
} | |
}, 300); | |
}); | |
$(previus).click(function(){ | |
setTimeout(function(){ | |
var itemSlide = $(".itemSlider--Show").animate({ | |
'margin-left': '+=+343px' | |
}, 800, function(){ | |
// | |
//alert('hola'); | |
}); | |
var s = $(itemSlide)[0].offsetLeft; | |
console.log(s); | |
if(s == -343) { | |
$(".itemSlider--Previus").hide('slow'); | |
$(".itemSlider--Next").show('slow'); | |
} | |
else if(s == -686) { | |
$(".itemSlider--Next").show('slow'); | |
} | |
}, 300); | |
}); | |
} | |
slider(); | |
function mobile(mobile){ | |
var a = mobile; | |
var m = 0; | |
var p = 760; | |
if(a == 0 || a <= p) { | |
alert('estoy en un mobil'); | |
} | |
} | |
mobile(window.innerWidth); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment