Comments (3)
I think the problem appears because you generate HTML asynchronously, so you run the lbSlider before the HTML has already generated. You should run lbSlider in callback function after HTML is generated.
from lbslider.
Thank you... Actually I figured out what the issue was..
I was building the HTML snippet dynamically and everytime a tag was generated I would use the append method of the element property of the $widget to build the HTML. THe problem was when appending for example the UL tag, the append method automatically also would add the closing tag as well, and hence the LI elements never ended up being the children of the UL element.
e.g. I was calling this.element.append(htmlSnippet); where to begin with htmlSnippet was "
- " and hence the append method would automatically add the "</ul"> before getting to generate the "
- " children.
The fix is to create the HTML snippet string, in its entirety and then once everything is generated, call the append method to add it to this.element. The UL element is definitely required and it must have LI children for this to work.
from lbslider.
Hey I have same problem.... Please view this..
/// This Is Ajax Dynamic HTML Generation Code////////
jQuery.ajax({
url: "http://ec2-52-21-208-137.compute-1.amazonaws.com:5000/api/v1/mobile/videos/" + catname + "/" + appid,
type: "GET",
data: {
'category': catname
},
dataType: 'json',
success: function(response) {
var cat_name = catname.replace(/\s/g, "_");
console.log(cat_name);
var str = "
- ";
- ";
$.each(response, function(index, val) {
source = val.isYoutube == true ? 'y-' + val.viemoId : 'v-' + val.viemoId;
str += "
});
str += "
$("#vm-videolist").append(str);
},
complete: function() {
//console.log('on completed');
},
error: function(xhr) { // if error occured
var str = '
$('#videos').append(str);
},
});
/////I have make this code for slider/////
$('#slide_content').slick({
dots: true,
infinite: false,
speed: 300,
slidesToShow: 4,
slidesToScroll: 4,
});
from lbslider.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lbslider.