Tocmai am scris un articol pe blog despre cum sa afisez thumbnail-ul site-ului spre care link-uieste un ... link la mouse over. Codul are doar 10 linii si se bazeaza pe jQuery si thumbalizr:
- $("a.thumbalizer").mouseenter(function(){
- var pos = $(this).offset();
- var top = pos.top-170;
- var left = pos.left;
- var url = $(this).attr('href');
- $('body').append('<img id="thumbalizer_hover" src="http://api.thumbalizr.com/?url=%27+url+%27&width=200" style="position: absolute; background: none repeat scroll 0% 0% rgb(0, 0, 0); padding: 5px; display: none;">');
- $('#thumbalizer_hover').fadeIn();
- }).mouseleave(function(){
- $('#thumbalizer_hover').fadeOut();
- $('#thumbalizer_hover').remove();
- });
Tot ce mai ramane de facut este sa adaugati clasa "thumbalizer" link-urilor la care vreti sa apara thumbnail. Codul este destul de simplu, insa daca are cineva nelamuriri, go ahead and shoot si va raspund eu
Welcome to BitCell. Click here to register !