<div id="tabs"> <ul> <li><a href="#tabs-1">公司</a></li> <li><a href="#tabs-2">员工</a></li> <li><a href="#tabs-3">集装箱</a></li> </ul> <div id="tabs-1">Company</div> <div id="tabs-2">Employee</div> <div id="tabs-3">Container</div></div>
# POST /containers # POST /containers.xml def create @container = Container.new(params[:container]) respond_to do |format| if @container.save flash[:notice] = 'Container was successfully created.' format.html { redirect_to @container) } format.xml { render :xml => @container, :status => :created, :location => @container } else format.html { render :action => "new" } format.xml { render :xml => @container.errors, :status => :unprocessable_entity } end end end
# POST /containers # POST /containers.xml def create @container = Container.new(params[:container]) respond_to do |format| if @container.save flash[:notice] = 'Container was successfully created.' format.html { redirect_to container_path(@container, :anchor => "tabs-3") } format.xml { render :xml => @container, :status => :created, :location => @container } else format.html { render :action => "new" } format.xml { render :xml => @container.errors, :status => :unprocessable_entity } end end end
1 svn co http://jquery-ui.googlecode.com/svn/tags/latest/themes/flora/
1 curl -O http://code.jquery.com/jquery-latest.js 2 curl -O http://dev.jquery.com/view/tags/ui/latest/ui/ui.core.js 3 curl -O http://dev.jquery.com/view/tags/ui/latest/ui/ui.tabs.js
1 wget http://code.jquery.com/jquery-latest.js 2 wget http://dev.jquery.com/view/tags/ui/latest/ui/ui.core.js 3 wget http://dev.jquery.com/view/tags/ui/latest/ui/ui.tabs.js
1 vi tabs.html
1 <html><head> 2 <!— 1. 说明CSS文件和jQuery文件的位置 BEGIN —> 3 <script src="jquery-latest.js"></script> 4 <link rel="stylesheet" href="flora/flora.all.css" type="text/css" media="screen" title="Flora (Default)"> 5 <script type="text/javascript" src="ui.core.js"></script> 6 <script type="text/javascript" src="ui.tabs.js"></script> 7 <!— 1. 说明CSS文件和jQuery文件的位置 END —> 8 9 <!— 2. jQuery代码 BEGIN —> 10 <script> 11 $(document).ready(function(){ 12 $("#example > ul").tabs(); 13 }); 14 </script> 15 <!— 2. jQuery代码 END —></head><body> 16 17 <!— 3. 与jQuery代码相关的HTML代码 BEGIN —> 18 <div id="example" class="flora"> 19 <ul> 20 <li><a href="#fragment-1"><span>One</span></a></li> 21 <li><a href="#fragment-2"><span>Two</span></a></li> 22 <li><a href="#fragment-3"><span>Three</span></a></li> 23 </ul> 24 <div id="fragment-1">tab1 内容</div> 25 <div id="fragment-2">tab2 内容</div> 26 <div id="fragment-3">tab3 内容</div> 27 </div> 28 <!— 3. 与jQuery代码相关的HTML代码 END —></body></html>
<div id="main">
<ul id="navigation">
<a class="head" href="?p=1.1.1">Guitar</a>
<a class="head" href="">Guitar</a>
<%= javascript_include_tag 'jquery-1.2.6' %><%= javascript_include_tag 'application' %>
【实 × 新 × 奇】http://www.lycom.de/ 最新报道Ruby语言、Rails框架、Ubuntu、MacOSX和软件技术信息
订阅 full-text RSS 或者 comments RSS.
Interesting links can be found at del.icio.us or by subscribing to my del.icio.us feed
Powered by SimpleLog