Changes to fancy

This commit is contained in:
Kasper Rynning-Tønnesen
2015-11-25 20:12:29 +01:00
parent 779cdaf411
commit fd649665c5
4 changed files with 38 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ var Nochan = {
pre_card = $(list_html);
Nochan.add_backdrop(lists, 0);
for(x in lists)
{
@@ -84,6 +86,35 @@ var Nochan = {
if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
}
return "";
},
add_backdrop: function(list, i) {
console.log(list.length)
if(i >= list.length) i = 0;
var id = list[i][1];
$.ajax({
type: "POST",
data: {id:id},
url: "/php/imageblob.php",
success: function(data){
//data will contain the vote count echoed by the controller i.e.
$(".mega").css("opacity", 0);
setTimeout(function(){
$(".mega").css("background", "url(data:image/png;base64,"+data+")");
$(".mega").css("background-size" , "200%");
$(".mega").css("opacity", 1);
$("#search").attr("placeholder", list[i][3]);
},1000);
//then append the result where ever you want like
//$("span#votes_number").html(data); //data will be containing the vote count which you have echoed from the controller
}
});
setTimeout(function(){
Nochan.add_backdrop(list, i+1);
},6000);
}