<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<style type="text/css">
#mini-gallery {
width:300px;
margin:0px auto;
font:normal 11px Verdana,Arial,Sans-Serif;
color:#494848;
padding:8px;
background-color:#7E7E7E;
-webkit-box-shadow:0px 1px 3px rgba(0,0,0,0.4);
-moz-box-shadow:0px 1px 3px rgba(0,0,0,0.4);
box-shadow:0px 1px 3px rgba(0,0,0,0.4);
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
}
#mini-gallery h2 {
font:normal 14px Impact,Arial,Sans-Serif;
color:#1CAA01;
text-shadow:0px 1px 0px black;
text-transform:uppercase;
margin:2px 2px 2px;
padding:7px 14px;
background-color:#292929;
}
#mini-gallery .rp-item {
float:left;
display:inline;
position:relative;
margin:2px;
padding:0px 0px;
background:#fff url('http://reader-download.googlecode.com/svn/trunk/images/loading-white.gif') no-repeat 50% 50%;
width:71px;
height:71px;
}
#mini-gallery .rp-item img {
width:71px;
height:71px;
border:none !important;
margin:0px 0px !important;
padding:0px 0px !important;
background:transparent !important;
display:none;
}
#mini-gallery .rp-item .rp-child {
position:absolute;
top:95%;
left:95%;
z-index:1000;
width:200px;
background-color:white;
border-top:4px solid #00C200;
-webkit-box-shadow:0px 0px 3px rgba(0,0,0,0.7);
-moz-box-shadow:0px 0px 3px rgba(0,0,0,0.7);
box-shadow:0px 0px 3px rgba(0,0,0,0.7);
padding:10px 15px;
overflow:hidden;
word-wrap:break-word;
display:none;
}
#mini-gallery .rp-item .rp-child h4 {
font-size:12px;
margin:0px 0px 5px;
color:#09AC0F;
}
#mini-gallery .rp-item:hover .hidden {display:block;}
</style>
<script type="text/javascript">
var rpTitle = "Recend Posts", // Τιτλος widget
numposts = 12, // Αριθμος εμφανιζομενων αναρτησεων
numchar = 300, // Αριθμος χαρακτηρων Tooltip
rcFadeSpeed = 600, // Ταχυτητα εμφανισης Tooltip
pBlank = "http://2.bp.blogspot.com/-11FkySHGB5Y/TpZ6SSbsF2I/AAAAAAAAA94/zK10UaL7jgo/s1600/images.jpeg", // URL της εικονας που θα εμφανιζεται οταν δεν εχετε εικονα στην αναρτηση
blogURL = "http://www.favoritebtemplates.com/"; // Το URL της Σελίδας σας
</script>
<script>
// Recent Post Mini Thumbnail with Tooltip by Taufik Nurrohman
// Visit: http://hompimpaalaihumgambreng.blogspot.com
// Have fun modifying this widget but make sure to keep the original attribution stay here :)
$(function() {
$('div.rp-item img').hide();
$('div.rp-child').removeClass('hidden');
var winWidth = $(window).width(),
winHeight = $(window).height(),
ttWidth = $('div.rp-child').outerWidth(),
ttHeight = $('div.rp-child').outerHeight(),
thumbWidth = $('div.rp-item').outerWidth(),
thumbHeight = $('div.rp-item').outerHeight();
$('div.rp-item').css('position', 'static').mouseenter(function() {
$('div.rp-child', this).filter(':not(:animated)').fadeIn(rcFadeSpeed);
}).mousemove(function(e) {
var top = e.pageY+20,
left = e.pageX+20;
if (top + ttHeight > winHeight) {
top = winHeight - ttHeight - 40;
}
if (left + ttWidth > winWidth) {
left = winWidth - ttWidth - 40;
}
$('div.rp-child', this).css({top:top, left:left});
}).mouseleave(function() {
$('div.rp-child', this).hide();
});
});
function showrecentposts(json) {
var entry = json.feed.entry;
for (var i = 0; i < numposts; i++) {
var posturl;
for (var j=0; j < entry[i].link.length; j++) {
if (entry[i].link[j].rel == 'alternate') {
posturl = entry[i].link[j].href;
break;
}
}
if ("content" in entry[i]) {
var postcontent = entry[i].content.$t;
} else if ("summary" in entry[i]) {
var postcontent = entry[i].summary.$t;
} else {
var postcontent = "";
}
var re = /<\S[^>]*>/g;
postcontent = postcontent.replace(re, "");
if (postcontent.length > numchar) {
postcontent = postcontent.substring(0,numchar) + '...';
}
var poststitle = entry[i].title.$t;
if ("media$thumbnail" in entry[i]) {
postimg = entry[i].media$thumbnail.url
} else {
postimg = pBlank
}
document.write('<div class="rp-item"><a href="' + posturl + '"><img src="' + postimg + '" alt="thumb" /></a>');
document.write('<div class="rp-child hidden"><h4>' + poststitle + '</h4>');
document.write(postcontent + '</div>');
document.write('</div>');
}
}
document.write('<div id="mini-gallery"><h2>' + rpTitle + '</h2><sc' + 'ript src="' + blogURL + '/feeds/posts/default?max-results=' + numposts + '&orderby=published&alt=json-in-script&callback=showrecentposts"></sc' + 'ript><div style="clear:both;"></div></div>');
var i = 0, int=0;
$(window).bind("load", function() {
var int = setInterval("doThis(i)",400);
});
function doThis() {
var imgs = $('div.rp-item img').length;
if (i >= imgs) {clearInterval(int);}
$('div.rp-item img:hidden').eq(0).fadeIn(400);
i++;
}
</script>
Tag :
1

0 nhận xét "Recend Posts có ảnh hiển thị"