Bing.com 如何创建放大的缩略图?

发布于 2024-07-25 14:22:09 字数 341 浏览 8 评论 0原文

当我使用 Bing.com 搜索图像时,我发现它们的图像经过精心裁剪和排序。 当您将鼠标放在图像上时,会弹出另一个窗口,其中显示放大的图像。

http://www.bing.com/images/search?q =Heros&FORM=BIFD#

我想在我的程序中做同样的事情。 我检查了他们页面的源代码。 他们正在使用 javascript,但我仍然不知道他们是如何制作的。 有熟悉的人吗? 欢迎任何建议。

When I search images using Bing.com, I realize their images are well cropped and sorted. When you place your mouse on an image, another window will pop up with an enlarged image.

http://www.bing.com/images/search?q=Heros&FORM=BIFD#

I want to do the same thing in my program. I checked the source code of their page. They are using javascript, but still I have no clue how they make it. Does anyone familiar with it? Any suggestion is welcomed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

抚笙 2024-08-01 14:22:09

如果您查看 HTML,您会在每个图像的正上方看到一个跨度。 它将该框架的显示样式从“无”设置为“块”。 然后,它使用动画库来调整覆盖帧内容的大小。

If you look at the HTML, you'll see a span immediately above each of the images. It sets that frame's display style from "none" to "block". It then uses an animation library to resize the content of the covering frame.

吻风 2024-08-01 14:22:09

这是同一个图像。 它只是稍微放大了它。

It's the same image. It just enlarges it slightly.

淡淡的优雅 2024-08-01 14:22:09

这是一个简单的 HTML/CSS/Javascript 示例,用于使用 javascript 更改元素的显示属性:

HTML:

<div id="image1" class="image" onmouseover="showImg(1);">
   Here's the small image
</div>
<div id="bigImage1" class="bigImage" onmouseout"hideImg(1);">
   Here's the enlarged image and info about the picture
</div>

Javascript:

function showImg(num){
   document.getElementById('bigImage' + num).style.display='block';
}

function hideImg(num){
   document.getElementById('bigImage' + num).style.display='none';
}

CSS:

.bigImage{
   display:none
}

他们还使用了一种奇特的过渡方式,例如 scriptaculous 的effect-grow 发现 这里。

Here's a simple HTML/CSS/Javascript example on changing the display property of an element with javascript:

HTML:

<div id="image1" class="image" onmouseover="showImg(1);">
   Here's the small image
</div>
<div id="bigImage1" class="bigImage" onmouseout"hideImg(1);">
   Here's the enlarged image and info about the picture
</div>

Javascript:

function showImg(num){
   document.getElementById('bigImage' + num).style.display='block';
}

function hideImg(num){
   document.getElementById('bigImage' + num).style.display='none';
}

CSS:

.bigImage{
   display:none
}

They also use a fancy transition thing like scriptaculous's effect-grow found here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文