How does the DiggBar work?

为君一笑 提交于 2019-11-30 02:30:27

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.

It may well be a horrible blight on the interweb in your opinion but that wasn't what the man asked - why do you think anyone cares whether you think these tool bars should exist out there or not? no ones asking you to use em.

If you feel that they shouldn't then simply butt out and let someone else answer the question. After all if they really are so unpopular folk will vote with thier mice and go elsewhere and the sites that deploy them will dwindle to nothing. Thats whats so great about the web, it doesn't need impotent geeks dictating whats good and whats not folk can decide for themselves.

Happy coding your way.

First of all, please don't do something like that, I don't know anyone that likes those things.

Something can be kept at the top like that using the CSS:

position: fixed;

As for specifying the URL, I'm not sure exactly what you're asking. When you click on a link on digg now, the destination URL is something like this:

http://digg.com/d1oIyx

The "d1oIyx" would just be used as a primary key into a database where they're storing the URL to be loaded in the bottom iframe.

yos

thanks , i found a solution that work ( attached ) , but how i make it full page iframe ?

working link : http://www.clalit.org/2.php?link=http://cnn.com

<?php
$link=$_GET["link"];
echo "<iframe src=\"$link\"/>";
?>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!