现在的位置: 首页 > 综合 > 正文

论GBIN1.com底部今日推荐功能开发原理

2019年10月29日 ⁄ 综合 ⁄ 共 1100字 ⁄ 字号 评论关闭

查看效果:http://www.gbin1.com/technology/html/20120328crazyhtml5js/index.html

// html
<div id="msgwrap">
    <span id="title">今日推荐</span><a id="msgclose" href="#">&nbsp;</a>
    <div id="latest"></div>
</div>

 // script

// Today's recommendation
var msgclose =
$('#msgclose');
var msg =
$('#msgwrap');
var latest =
$('#latest');
latest.load('/portfolio/lastest.html .includetitle',
function() {
latest.find('.includetitle').hide();
var
aobjs
= latest.find('a');
aobjs.each(function(){
var
srcval
= $(this).attr('href').replace('..','');
$(this).attr('href',srcval);
});
});
setTimeout(function(){msgclose.fadeIn();msgclose.click();},
10*1000);
msgclose.toggle(function() {
msg.stop().animate({width:'+=250',bottom:'+=20px'},500,function()
{
latest.find('.includetitle').eq(getRan(4)).fadeIn();
});
$('#msgclose').css({'background-image':'url("/gbin1/themes/gbin1_3column/images/x_icon.png")'});
},
function() {
$('#latest').find('.includetitle').hide();
msg.stop().animate({width:'-=250',bottom:'-=20px'},500);
$('#msgclose').css({'background-image':'url("/gbin1/themes/gbin1_3column/images/icon_plus.png")'});
});

function
getRan
(n){
return
Math.floor(Math.random()*n+1);
}

抱歉!评论已关闭.