I have been working on a jquery slider using flickerplate. Below is the code that works when the values are hardcoded:
<div class="flicker-example">
<ul>
<li data-background="lib/flicker-1.jpg">
<div class="flick-title">Promo 1</div>
<div class="flick-sub-text">25$ OFF FLAT !! Limited Offer!</div>
</li>
<li data-background="lib/flicker-2.jpg">
<div class="flick-title">Promo 2</div>
<div class="flick-sub-text">Bumper Sale !! Buy 1 Get 1 Free !!</div>
</li>
</ul>
</div>
My goal is to load the content using a JSON array. Here is the code I have written:
<div class="flicker-example">
<ul>
<script type='text/javascript'>
$(document).ready(function(){
$.getJSON('http://testdb2.weby.biz/deallist.php', function(data) {
$.each(data, function(key, val) {
$(".flicker-example ul").append('<li data-background="'+ val.Product_Variant_Image + '"><div class="flick-title">' + val.Product_Brand_Name + '</div><div class="flick-sub-text">' + val.Product_Variant_Name + '</div></li>');
});
});
});
</script>
</ul>
</div>
I am having trouble making the dynamically loaded content work like the hardcoded one. Any help would be greatly appreciated. Thank you!