Willin Wang

长岛冰泪的前端开发原创博客
长岛冰泪

Additional Learning on website2论文

2010年六月19日 下午 11:15

(节选)

xHtml instance with jQuery: Willin-Page

Description

WillinPage

简介:

WillinPage是一个简单的静态网站,介绍了Willin OR Guy(长岛冰泪个人博客)和Willin Studio。

整站共7个静态页面,符合W3C xhtml 1.0规范,加入了CSS3元素(IE只支持到CSS 2.1)。运用jQuery代码实现了整站AJAX。

Willin-Page

演示截图

在线演示:DEMO

说明:

  1. IE下需要允许脚本或ActiveX控件。
  2. 顶部导航栏红色表示当前的页面,点击无效。
  3. 因为IE6下,自动切换jQuery效果不如Flash,但是网上仍有近30%的人在使用IE6,所以首页幻灯设置为鼠标滑过切换。放弃IE这个世界该会多么美好。IE下会显示抱怨信息,点击后隐藏。

下载地址:源代码 / 备用地址

Core Codex

  1. Ajax Module Code of jQuery:

//全局Ajax函数

$("#loading").ajaxStart(function(){
 
$(this).fadeIn('fast');
 
$('#ajaxpost').hide(0);
 
});
 
$("#loading").ajaxStart(function(){
 
$(this).fadeOut(100);
 
$('#ajaxpost').fadeIn(1000);
 
});
 
$('.homelink').click(function(){
 
if($(this).parent('li').is('.current_page_item')) return false;
 
$.ajax({
 
url: "html/home.html",
 
cache: false,
 
success: function(msg){
 
$("#ajaxpost").html(msg);
 
$.getScript("js/willin-tab.js");
 
}});
 
$('li.current_page_item').removeClass('current_page_item');
 
$('.homelink').parent('li').addClass('current_page_item');
 
return false;
 
});
  1. CSS of Willin-Tab:
#msgbox ul{padding-left:5px}
 
#msgbox-left{border:1px dashed #ccf; display:block; float:left; height:205px; overflow:hidden; position:relative; width:33%}
 
#msgbox-right{border:1px dashed #ccf; display:block; float:right; height:205px; overflow:hidden; position:relative; width:66%}
 
#msgtabup,#msgtabdown{padding:1px; width:100%}
 
#msgtabdown{bottom:0; float:right; position:absolute; right:0; width:auto; z-index:999}
 
#msgtabdown img{border:0; margin-right:5px}
 
#msgtabdown img.current{border:1px dashed #f06!important; color:#f06}
 
#msgspan{bottom:24px; color:#f06; display:inline-block; height:20px; position:absolute; right:5px; z-index:999; background:#fff; opacity:0.8}
 
.msgtab{display:none; width:99%}
 
.msgtab span{color:#099; font-style:italic}
 
.msgtab li{background:url(img/lim.gif) no-repeat center left; padding-left:15px !important; margin-top:3px !important; font-size:12px !important;}
 
#msgbox-left li { padding-left:15px !important; margin-top:5px !important; background: url(img/lil.gif) no-repeat center left !important;}
 
.msgtitle{border-bottom:1px dashed #ccf; color:#f06; padding-left:5px; vertical-align:middle; width:100%}
 
.msgtitle img{cursor:pointer; margin-right:5px; vertical-align:middle}
  1. Willin-Tab of jQuery:
jQuery(document).ready(function($){
 
$('.msgtab:first').css('display','block');
 
$('#msgtabs-1').addClass('current');
 
$('#msgspan').text($('#msgtabs-1').attr('alt'));
 
var i=0;
 
function slide(i){
 
$('#msgtabdown img').removeClass('current');
 
$('#msgtabs-'+i).addClass('current');
 
$('#msgspan').text($('#msgtabs-'+i).attr('alt'));
 
$('.msgtab').stop(true,true).slideUp();
 
$('#msgtab-'+i).stop(true,true).slideDown();
 
}
 
$('#msgtabdown img').hover(
 
function () {
 
i = $(this).prevAll().length+1;
 
slide(i);
 
},function () {
 
}
 
);
 
});

RSS订阅也想要建立一个独立博客打造自我品牌吗?
RSS订阅如果你喜欢本文或对我的Willin OR Guy感兴趣,请订阅本博客如何订阅?


版权声明

作者:长岛冰泪,网址:http://www.willin.org/
原文标题:Additional Learning on website2论文
原文链接:http://www.willin.org/develop/niit/add-onweb2/
(C) 长岛冰泪 版权所有,转载时必须以链接形式注明作者和原始出处及本声明。

相关日志

7 条评论 在 “Additional Learning on website2论文” 上

  1. 哲哲 说:

    好像这个挺有意思的,呵呵

  2. Dianso 说:

    我也去搞个玩玩 :mrgreen: ie8下也很丑陋

  3. 阿邙 说:

    沙你个发
    呵呵 速度不错啊 很厉害 呵呵

发表评论


添加图片 添加表情

评论RSS

文章归档

赞助商

BloggerAds