不微正业
百度空间 | 百度首页 
               
 
文章列表
 
2008-10-09 22:41
/*@cc_on
@if (@_jscript_version >= 5)
    try {
      oXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        oXmlHttp = false;
      }
    }
@else
oXmlHttp = false;
@end @*/
if (!oXmlHttp && typeof XMLHttpRequest != 'undefined') {
    try {
      oXmlHttp = new XMLHttpRequest();
    } catch (e) {
      oXmlHttp = false;
    }
}

利用@cc_on使在浏览器不支持脚本的时候执行注释中的代码。
同时在注释中的@if 等,都被执行。

 
2008-02-01 13:17
第一步:
修改Game_Party中的
MAX_MEMBERS = 5

第二步:
追加脚本
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
#  显示菜单画面和同伴状态的窗口。
#==============================================================================

class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化目标
#     x : 窗口的X坐标
#     y : 窗口的Y坐标
#--------------------------------------------------------------------------
def initialize(x, y)
    super(x, y, 384, 416)
    refresh
    self.active = false
    self.index = -1
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_face(actor, 2, actor.index * 75 + 11, 92)
      x = 104
      y = actor.index * 75 + WLH / 2
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 120, y)
      draw_actor_level(actor, x, y + WLH * 0.9)
      draw_actor_state(actor, x, y + WLH * 1.8)
      draw_actor_hp(actor, x + 120, y + WLH * 0.9)
      draw_actor_mp(actor, x + 120, y + WLH * 1.8)
    end
end
#--------------------------------------------------------------------------
# ● 刷新光标矩形
#--------------------------------------------------------------------------
def update_cursor
    if @index < 0               # 没有光标
      self.cursor_rect.empty
    elsif @index < @item_max    # 通常
      self.cursor_rect.set(0, 10+@index * 75, contents.width, 75)
    elsif @index >= 75         # 自己
      self.cursor_rect.set(0, (@index - 75) * 75, contents.width, 75)
    else                        # 全体
      self.cursor_rect.set(0, 0, contents.width, @item_max * 75)
    end
end
end



#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
#  显示战斗画面同伴状态的窗口。
#==============================================================================

class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
    super(0, 0, 416, 180)
    refresh
    self.active = false
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
    super
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for i in 0...@item_max
      draw_item(i)
    end
end


#--------------------------------------------------------------------------
# ● 描绘项目
#     index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    rect.y -=4
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    actor = $game_party.members[index]
    draw_actor_name(actor, 4, rect.y)
    draw_actor_state(actor, 114, rect.y, 48)
    draw_actor_hp(actor, 174, rect.y-3, 120)
    draw_actor_mp(actor, 310, rect.y-3, 70)
end
end

 
2008-01-25 23:20
其实这个东西距离还是有一段时间的。不过刚刚看了介绍之后感觉网页布局技术在HTML5到来后必将有新的思路了。不再拘泥于CSS+DIV的布局方式。
因为HTML5本身提供的标签就能够完成了布局的要求。

HTML4页面布局:

HTML5页面布局:


在使用HTML5后,布局代码就变成了:
<body>
<header>...</header>
<nav>...</nav>
<article>
<section>
...
</section>
</article>
<aside>...</aside>
<footer>...</footer>
</body>

像什么?我说它像XML。
当然,最让人期待的还是新添加的<video>与<audio>标签。

原文地址:http://www.alistapart.com/articles/previewofhtml5
译文地址:bbs.blueidea.com/thread-2826586-1-1.html
W3C网站上关于HTML4和HTML5的区别:
http://www.w3.org/html/wg/html5/diff/
 
2008-01-14 23:36

                                             

老东西了~呵呵,翻上来……

 
2008-01-14 23:33

用css样式来根据图片的实际大小和限制大小进行等比缩小。

<style>
img {
max-width: 500px;
width: expression( this.width > 500 ? "500px" : (this.width "px") );
height:auto;
}
</style>

this.width就是当前图片的宽度,然后是用一个正则表达式来实现,大于500px就默认为500px否则不变。
高度设成auto也就保证了图片的比例。

 
     
 
 
个人档案
 
slxvista
男, 23岁
北京 昌平区 
上次登录:
30天前
加为好友
 
   
 
留言板
 

春天到...桃花开.... 玉石婚纱摄影记录您最美的那一刻.....
 

http://jpkc.ynnubs.com/Jp_web_2008/imges_2008/zhidao.htm
 

h1 { font: bold 330%/100% "Lucida Grande"; position: relative; color: #464646; }...
 
     
 
最新评论
 
     
 
最近访客
 
 

sgms_cat

qpsony

harite

维动小天

98303

dmgylcjava

神不眷顾我

dongaiping
     


©2009 Baidu