Vote count:
0
I am trying to adapt an endless draggable wall mootools plugin (http://wall.plasm.it/) to work with wordpress. More exactly, if you look on the code bellow, you'll see that each element of the wall, is an img fetched from a folder on the server (var a = new Element("img[src=/your/folder/images/"+counterFluid+".jpg]");) . What I need it to do, is to fetch existing wordpress posts, or posts content (probably set as hidden), and inject them into the grid, just like the image fetched from the server is. So var a should be set to 'document.getElementsByClassName('classname').innerHTML', or somtehing similar if I'm not wrong. I have tried different approaches but I cant really figure how could I code this in order to fetch wordpress post content. Any ideas? Thank you!
// Define The Wall
var maxLength = 100; // Max Number images
var counterFluid = 1;
var wallFluid = new Wall("wall", {
"draggable":true,
"inertia":true,
"width":150,
"height":150,
"rangex":[-100,100],
"rangey":[-100,100],
callOnUpdate: function(items){
items.each(function(e, i){
var a = new Element("img[src=/your/folder/images/"+counterFluid+".jpg]");
a.inject(e.node).fade("hide").fade("in");
counterFluid++;
// Reset counter
if( counterFluid > maxLength ) counterFluid = 1;
})
}
});
// Init Fluid Wall
wallFluid.initWall();
Aucun commentaire:
Enregistrer un commentaire