在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
原文章:
Customizable Home Pages
现在似乎每个主要的网站都可以个性化的定制,“my”(我的),主页(my.yahoo.com,my.msn.com,my.ebay.com …). 这实际上很容易实现,只要你舍弃了以Table为基本框架的网页设计。看看下面的设计:
你可能会花费一整天来设置你的页面布局,但最后却一团糟,难以更新,编码。或者你可以使用DIV标签,使用一半的HTML,并用CSS来处理所有的设计样式。
<div class="main">
<div class="left"> <div class="leftSubheadDark" runat="server" id="hdStocks">Stocks</div> <div class="leftSubDark" runat="server" id="Stocks"> DJIA 10087.51 -191.24 <br> NASDAQ 1908.15 -38.56 <br> YHOO 32.46 -1.00 <br> <asp:LinkButton Runat="server" ID="HideStocks">Hide</asp:LinkButton> </div> <div class="leftSubheadLight" runat="server" id="hdDates">Events</div> <div class="leftSubLight" runat="server" id="Dates"><b>July 4:</b> Independence Day <br> <b>December 25:</b> Christmas<br> <b>January 1:</b> New Years Day<br> <asp:LinkButton Runat="server" ID="hideDates">Hide</asp:LinkButton></div> <div class="leftSubheadDark" runat="server" id="hdWeather">Weather</div> <div class="leftSubDark" runat="server" id="Weather">Lincoln, NE : 53/72 F <br> <asp:LinkButton Runat="server" ID="hideWeather">Hide</asp:LinkButton></div> </div> <div class="right"> <div class="rightSubheadYellow" runat="server" id="hdTopStories">Top Stories</div> <div class="rightSubYellow" runat="server" id="TopStories">The Sky Is Falling<br> Governer Alberts Re-Elected to 22nd term<br> Scientist Predict Next Earthquake<br> <asp:LinkButton Runat="server" ID="hideTopStories">Hide</asp:LinkButton></div> <div class="rightSubheadYellow" runat="server" id="hdWord">Word of the Day</div> <div class="rightSubYellow" runat="server" id="Word"><b>hero</b><br> n. pl. he·roes<br> <br> 1. In mythology and legend, a man, often of divine ancestry, who is endowed with great courage and strength, celebrated for his bold exploits, and favored by the gods.<br> 2. A person noted for feats of courage or nobility of purpose, especially one who has risked or sacrificed his or her life: soldiers and nurses who were heroes in an unpopular war. <br> <asp:LinkButton Runat="server" ID="hideWord">Hide</asp:LinkButton> </div> </div> </div> 现在你的网页内容被整洁的包含在DIV标签里面,当用户点击 hide按钮的时候就可以隐藏相应的内容。
在实际的情况下,你很可能有一个注册/登录系统,把用户的参数信息存储在数据库里面。你可以载入参数信息并在Page Load事件里面隐藏不需要显示的内容。显然你大概也想到要实现一个页面让用户能够使用checkbox来选择需要显示的内容。你也可以简单的使用javascript和每个内容模块中的链接来“最小化”该内容模块。这个代码与本页面左边的导航菜单上用的是相似的。
|
请发表评论