启用图像拖动以将站点固定到IE9中的Windows任务栏

I blogged in September about a some features of IE9 that I really dug, specifically adding Jump Lists to your website and Pinning WebSites to the Taskbar.

我在9月写了一篇关于IE9的某些功能的博客,我特别研究了这些功能,特别是将“跳转列表”添加到您的网站,并将“网站”固定到“任务栏”

I made a few small markup changes and now you can pin this blog to your taskbar if you're running Windows 7. I also added right-click Jump Lists to this blog as well.

我做了一些小的标记更改,现在,如果您正在运行Windows 7,则可以将此博客固定到任务栏上。我还向该博客中添加了右键单击“跳转列表”

However, I just noticed that the IE9 Release Candidate that just came out includes a little feature where you can drag an image from a website to pin the site to the taskbar.

但是,我刚刚注意到刚刚发布IE9候选版本包括一项小功能,您可以从网站上拖动图像以将该网站固定到任务栏

Clearly this feature was created as an opportunity for me to enable you, Dear Reader, do drag my giant forehead to the Windows 7 taskbar. No question.

显然,创建此功能是给我一个机会,亲爱的读者,您可以将我的额头拖到Windows 7任务栏上。 没有问题。

启用图像拖动以将站点固定到IE9中的Windows任务栏 (Enabling Dragging of an Image to Pin a Site to the Windows Taskbar in IE9)

All I had to do was add:

我要做的就是添加:

class="msPinSite"

class =“ msPinSite”

to the image I wanted to use. You can set other options as well, like the image that's used while dragging (it uses favicon by default) as well as callouts for mouseovers and stuff.

到我想使用的图像。 您还可以设置其他选项,例如拖动时使用的图像(默认情况下使用favicon)以及鼠标悬停和其他内容的标注。

I just did this, as it was simpler:

我这样做是因为它更简单:

<img class="msPinSite" src="http://www.hanselman.com/blog/images/tinyheadshot2.jpg" alt="Scott Hanselman" title="Drag this image to your Windows 7 Taskbar to pin this site with IE9 - Scott Hanselman">

<img class =“ msPinSite” src =“ http://www.hanselman.com/blog/images/tinyheadshot2.jpg” alt =“ Scott Hanselman” title =“将此图像拖到Windows 7任务栏上,以使用IE9-Scott Hanselman“>

Here I am dragging my headshot to the taskbar to pin it. Of course, you can always pin any site by dragging the favicon from the address bar.

在这里,我将头像拖动到任务栏上以进行固定。 当然,您始终可以通过从地址栏中拖动收藏夹图标来固定任何站点。

Dragging the image down to the Taskbar.

You can even add little toolbars to taskbar with JavaScript (for sites like Pandora, etc). It's all standard markup and JavaScript and it's setup in such a way that other browsers ignore it as they like.

您甚至可以使用JavaScript将小工具栏添加到任务栏(用于Pandora等网站)。 所有这些都是标准标记和JavaScript,并且其设置方式使其他浏览器都可以忽略它们。

You can also use JavaScript to push alerts to the icon, maybe for new messages, chat, etc. It's easy to this stuff, check it out there's a whole section on MSDN on Site Pinning. You can also View Source on this demo and figure it out. It took me 5-10 minutes. The hardest part for the Jump List was finding cool icons.

您还可以使用JavaScript将警报推送到该图标,例如用于发送新消息,聊天等。这些内容很容易,请查看Site Pinning上有关MSDN的整个部分。 您也可以在此演示中查看源代码并弄清楚。 我花了5-10分钟。 跳转列表最困难的部分是找到漂亮的图标。

One more very nice browser for my collection of All Non-Released Browsers. Yet.

我的所有非发布浏览器集合中,还有一个非常不错的浏览器。 然而。

IE9, FireFox 4, Chrome 11, Opera 11

Enjoy.

请享用。

翻译自: https://www.hanselman.com/blog/enabling-dragging-of-an-image-to-pin-a-site-to-the-windows-taskbar-in-ie9

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值