-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm trying to build a simple timeline from a simple slide. I went with http://bxslider.com/ as it has all the option i need.
I'm making a custom component that will generates "li" for each of the entry of my model.
The issue is I will have several of those timeline on one page. So I'm trying to use the jq selector from uuid. First issue, UL being a native component, id will not be generating a uuid. So I've added a container
Now my problem is when I use the jq selector i get anerror :
If in my JS I use the default jquery selector it works :
$('ul.bxslider').bxSlider();
But when i use the jq selector with the id!
jq('$container > ul').bxSlider();
"Uncaught TypeError: jq(...).bxSlider is not a function"
Same issue with jq('ul.bxslider')
When i evaluate both of those in the console i do get the slider ul though ... So how can i call external Jquery lib method from the zk jquery selector?
Thanks
"Uncaught TypeError: jq(...).bxSlider is not a function" means that bxSlider is not loaded correctly
1) Ensure that js lib is loaded and make sure that is like all javascript files at bottom of your file 2) Ensure that you call the function you are calling is in a zk.afterMount() because you are not sure that an object is totally loaded
Ended up retrieving the generated ID from the ZK uuid selector then called the Jquery selector.
But this is weird ...
var contUuid = '#' + jq('$container')[0].id;
$(contUuid + ' ul.bxslider').bxSlider();
There are to be something cleaner ...
Asked: 2015-11-24 13:54:05 +0800
Seen: 61 times
Last updated: Nov 25 '15