TwiSt^Up Mesaje : 40 | Subiect: Am si eu o mica problema la avatare! Mar 03 Dec 2013, 23:27 | |
| Salut imi poti da si mie scriptul asta https://2img.net/h/oi39.tinypic.com/1zxmgdh.jpg sa am si eu avatarele pe forum cu apare in imaginea de mai sus!
Multumesc!
|
|
H4cK3R*uL Mesaje : 12494 | Subiect: Re: Am si eu o mica problema la avatare! Mier 04 Dec 2013, 18:33 | |
| |
|
GriMMjOw Mesaje : 184 | Subiect: Re: Am si eu o mica problema la avatare! Mier 25 Dec 2013, 15:45 | |
| Salut, Adaugi in CSS: - Cod:
-
.mini_ava { float: left; } .mini_ava img { width: 40px; height: 40px; margin: 0 5px; border-radius: 1px; transition: all 1s; -moz-transition: all 1s; -webkit-transition: all 1s; -o-transition: all 1s; } si in JavaScript: - Cod:
-
$(function(){ if(!window.localStorage) return; // Avatar par défaut var default_avatar= 'http://2img.net/i/fa/invision/pp-blank-thumb.png'; // Temps de cache, ici 24 h * 60 m * 60 s * 1000 ms donc un jour var caching_time= 24*60*60*1000; // Temps de cache d'une erreur, ici 60 s * 1000 ms donc une minute var caching_error= 60*1000; var set_avatar= function(id) { $('.mini_ava.member'+id).html('<img src="'+get_avatar(id)+'" />'); }; var get_avatar= function(id) { if(localStorage.getItem('t_ava'+id) < +new Date - caching_time || (localStorage.getItem('d_ava'+id)==default_avatar && localStorage.getItem('t_ava'+id) < +new Date - caching_error)) { localStorage.setItem('d_ava'+id, default_avatar); $.get('/u'+id, function (d){ localStorage.setItem('t_ava'+id,+new Date); localStorage.setItem('d_ava'+id, $('#profile-advanced-right .module:first div img:first,.forumline td.row1.gensmall:first > img, .frm-set.profile-view.left dd img,dl.left-box.details:first dd img, .row1 b .gen:first img, .real_avatar img',d).first().attr('src')||default_avatar); set_avatar(id); }); } return localStorage.getItem('d_ava'+id); }; var to_replace= {}; $('dd.lastpost strong a.gensmall, .ipbtable tr td:last-child span strong a.gensmall, .table td.tcr strong a.gensmall, .forumline .row3.over strong a.gensmall').each(function(){ to_replace[$(this).attr('href').substr(2)]= 1; $(this).closest('td,dd').prepend('<div class="mini_ava member'+$(this).attr('href').substr(2)+'"></div>'); }); for(i in to_replace) { set_avatar(i); }; });
|
|
H4cK3R*uL Mesaje : 12494 | Subiect: Re: Am si eu o mica problema la avatare! Lun 27 Ian 2014, 21:32 | |
| |
|
Continut sponsorizat | Subiect: Re: Am si eu o mica problema la avatare!
| |
| |
|