问题描述
DiggBar如何工作?
我试图创建一个ASP.NET MVC DiggBar克隆只是为了学习目的,并有任何人有一个建议,如何指定内容的低级帧?
此外,我知道它是一个iFrame,但是它们如何定位,所以不管滚动它是否位于最佳?是CSS魔法吗?
编辑:我对你是否喜欢他们不感兴趣。我不是把一个投入生产,我不是问他们是否是好的设计。我只是〜想〜做一个。
我发现DiggBar很有用,我喜欢它。地狱,你可以在两次点击关闭它!类似地,reddit有一个reddit bar,它是opt-in(可能更好的方法)。
< html&
< head>
< style type =text / css>
#toolbar {position:fixed; top:0; height:40px;宽度:100%; ...}
#page {width:100%; height:100%;}
< / style>
< / head>
< div id =toolbar>
在这里所有的工具栏。
< / div>
< iframe id =pagename =pagesrc =http://url.to/pageframeborder =0noresize =noresize>< / iframe>
< / html>
您会在自己的URL上留下一个映射到页面URL的URL,例如
d1oKo3 => http://news.bbc.co.uk/2/hi/technology/7991708.stm
所有视图都必须是查找映射并将页面的URL放入 iframe 的 src 。只需确保您有一种方式让用户选择停用,因为有些人不喜欢这种工具栏。
How does the DiggBar work?
I'm trying to make an ASP.NET MVC DiggBar clone just for learning purposes and does anyone have a suggestion on how to specify the url of the content for the lower frame? How would you go about constructing that in MVC?
Also, I know that it is an iFrame, but how do they position it so regardless of scrolling it stays positioned at the top? Is it CSS magic?
Edit: I'm not interested in whether or not you like them. I am not putting one into production and I'm not asking for whether they are good design or not. I simply ~want~ to make one.
I find the DiggBar useful and I like it. Hell, you can turn it off in two clicks! Similarly, reddit has a reddit bar which is opt-in (probably better approach).
The basic html is:
<html> <head> <style type="text/css"> #toolbar {position: fixed; top: 0; height: 40px; width: 100%; ... } #page {width: 100%; height: 100%;} </style> </head> <div id="toolbar"> All your toolbar stuff here. </div> <iframe id="page" name="page" src="http://url.to/page" frameborder="0" noresize="noresize"></iframe> </html>
You would have a slug on your own URLs that maps to the page's URL, e.g.
d1oKo3 => http://news.bbc.co.uk/2/hi/technology/7991708.stm
All your view would have to do is look up the mapping and put the page's URL into the iframe's src. Just make sure you have a way for users to opt out, as some people don't like this sort of toolbar.
这篇关于DiggBar如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!