Flexslider Thumb Image Base 64

时间:2017-03-02 11:15:38

标签: javascript jquery html flexslider

我使用flexslider组件制作带缩略图的旋转木马。如果我将 data-thumb 属性与图像路径一起使用,我可以正常使用该组件,但是,我没有图像路径,但我有Base64。如何在Base64中使用带有图像的组件?

在我的代码下工作,没有Base64:



// Create 2 apart functions, one for mobile, one for desktop
function transposeTableMobile(){
    // Transpose to mobile
}
function transposeTableDesktop(){
    // Transpose to desktop
}

// Create a variable to check if already transposed
var transposed = "desktop";
$(document).ready(function(){
    // On page load
    // Transpose the table
    // Since this function runs only once,
    // we don't need to check if the table
    // is transposed
    if($(window).width() < 992){
        transposed = "mobile"
        transposeTableMobile();
    }else{
        transposed = "desktop"
        transposeTableDesktop();
    }
})
$(window).resize(function(){
    // On page resize
    // We check if the table is transposed to mobile,
    // if not, but should be, transpose it and store that
    // we transposed the table
    if($(window).width() < 992 && transposed != "mobile"){
        transposed = "mobile"
        transposeTableMobile();
    }else if(transposed != "desktop"){
        transposed = "desktop"
        transposeTableDesktop();
    }
})
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

我是通过制作一个Generic Handler来实现的,它将Base64转换为图像,因此组件可以获得一个URL。