I am working on slideshow. At the end I want to add current
class to my variable for next checking.
But that's not work, I also tried attr
but not working.
this is my code:
$(function () {
$('.large_image').children('img').addClass('current');
$('.product-item').click(function () {
if ($('.large_image > img').hasClass('current')) {
var $img = $(this).find('img').attr('data-img');
var $slider = '<img class="dis-none" style="position:absulote;z-index:999" src=' + $img + ' />';
$($slider).appendTo('.large_image').stop(true, true).delay(400).fadeIn(
function () {
$('.current').fadeOut(function () {
$(this).remove();
});
});
$($slider).attr('class', 'current');
$($slider).addClass('current');
}
})
});
Any help on how to resolve this issue?