Jssor dynamic thumbnail not working

為{幸葍}努か 提交于 2019-12-11 06:29:15

问题


I am trying to make a jssor gallery based of instagram feed. So far the images are succeeding, but not the thumbnails.

var img = '<img u="image" src="'+thisMedia.images.standard_resolution.url+'" alt="Instagram Image" data-filter="'+thisMedia.filter+'" width="720" height="480" />';
var thumb = '<img u="thumb" src="'+thisMedia.images.standard_resolution.url+'" width="99" height="66"/>';

$('#slide-'+i+'').html(img);
$('#slide-'+i+'').append(thumb);

This happens in the instafeed file and so far the img goes well in the gallery but not the thumb. Ive also tried to put the thumb code in the same line for the img variable.

When I open it in the browser and check what is happening i see the images and thumbnails correctly being put in the desired div slides. Allthough the thumbnails should be taken care of by the jssor code they just sit there, I basically copied the code of the demo version. Any idea what is happening?


回答1:


In the raw html, thumbnail for a slide is defined in following format.

        <div>
            <img u="image" src="../img/alila/01.jpg" />
            <img u="thumb" src="../img/alila/thumb-01.jpg" />
        </div>

When jssor slider initializes, it hide the thumbnail in the slide and copy a clone to thumbnail navigator. Actually, thumbnail navigator is a kind of slider.

You can inspect element to see how it arranges. If you need to replace thumbnails, please operate elements in thumbnail navigator.



来源:https://stackoverflow.com/questions/25406421/jssor-dynamic-thumbnail-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!