Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////ESTA FUNCION LLAMA RENDER
- function reccomendations() {
- var class_div = "widgetviral";
- var widgets = document.getElementsByClassName(class_div);
- for (i = 0; i < 4; i++) {
- order = widgets[i].getAttribute("data-order");
- count = widgets[i].getAttribute("data-count");
- nsfw = widgets[i].getAttribute("data-nsfw");
- div_actual = widgets[i];
- var premium = document.createElement("h3");
- premium.className += " wid_tit";
- premium.innerHTML = "Recommend Content";
- var ul = document.createElement("ul");
- ul.className += " pics_widget";
- widgets[i].appendChild(premium);
- widgets[i].appendChild(ul);
- render(order, count, nsfw, ul);
- var classname = document.getElementsByClassName("item_ad");
- /* for (var a = 0; a < classname.length; a++) {
- classname[a].addEventListener('click', onClickFunction, false);
- }*/
- }
- return true;
- }
- ////ESTA ES RENDER
- function render(order, count, nsfw, div_actual){
- for (i = 0; i < count; i++) {
- var li = document.createElement("li");
- li.className += "item_ad";
- if(size)
- li.style.width = size + "%";
- var div = document.createElement("div");
- div.innerHTML = lista[i].title;
- var a = document.createElement("a");
- a.href = slugify(lista[i].title);
- a.setAttribute('target', '_blank');
- //a.setAttribute('onclick', 'token_key()');//"'+ reverse(encodeURIComponent(lista[i].url)) +'","' + lista[i].id_tols + '"
- //a.setAttribute('data-tols', lista[i].id_tols);
- a.setAttribute('rel', 'nofollow');
- a.setAttribute('data-alt', lista[i].url);
- a.className = "item_a_"+lista[i].id_tols+" magic-link";
- /*a.target = "_blank";*/
- var figure = document.createElement("figure");
- var image = document.createElement("img");
- image.src = lista[i].image;
- figure.appendChild(image);
- a.appendChild(figure);
- a.appendChild(div);
- li.appendChild(a);
- div_actual.appendChild(li);
- }
- var classname = document.getElementsByClassName("item_ad");
- for (var i = 0; i < classname.length; i++) {
- classname[i].addEventListener('click', function(){
- moveElementToBottom(this);
- }, false);
- }
- }
- DONDE PONER EL CALLBACK Y COMO LLAMAR TU CODIGO, CON UNA FUNCION?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement