鼠标悬停效果 [英] Mouse over effect

查看:98
本文介绍了鼠标悬停效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好,

我正在寻求帮助鼠标在图像上的效果...我有100x100的图像我希望能够鼠标悬停在它们上面然后它拉出一个窗口,以更大的格式显示图像400x400


我想在这里使用此代码

展开 | 选择 | Wrap | 行号

解决方案

你仍然会使用JavaScript来在onmouseover期间显示更大的图像。图像的事件。


你可以做两件事之一。

你可以显示已经预装的图像(隐藏在页面上) )。

或者,您可以拨打一个只返回图像的ASPX页面。


您正在考虑使用哪个版本?

好的,你发给我的那条消息。


关于你的答案嗯这是一个更好的方法使用...我不认为有隐藏在页面上的20多张图片是一个好主意,加载时间会很长......


所以我不得不说在另一个页面上调用是一个好主意。 />

谢谢,


Chris


好的,这是一种常用的技巧用于显示从数据库中检索的缩略图或动态图像...它实际上可以用于图像之外的其他内容但是我可能应该首先解释它。


您创建一个新的ASPX页面您r项目,但是当浏览器调用时,此页面不会返回HTML。相反,它将返回图像。


在此ASPX页面的PageLoad事件中,您将通过设置Response.ContentType属性来更改页面返回的内容类型。你将加载图像,并将图像直接写入Response.Output流


例如(我不确定你是在做VB还是C#。 ..但这是VB代码):

展开 | 选择 | Wrap | 行号


Good afternoon,

I am seeking some help with a mouse over effect on an image... I have images that are 100x100 I would like to be able to mouse over them and it pull up a window showing that image in a larger format 400x400

I wanted to use this code here

Expand|Select|Wrap|Line Numbers

解决方案

You''d still use JavaScript for the to display the larger image during the "onmouseover" event of the image.

You could do one of two things at that point.
You could show an already preloaded image (that is hiding on the page).
Or, you could make a call to an ASPX page that simply returns an image.

Which version are you thinking about using?


Okay to that message you sent me.

As to your answer hmmm which is a better method to use... I do not think having up to 20 plus pictures hiding on the page is a good idea the load time would be to long...

So I would have to say calling on another page is a good idea.

Thank you,

Chris


Ok, there''s this neat technique that is commonly used for displaying thumbnails or dynamic images retrieved from a database... it can actually be used for things other than images but maybe I should explain it first.

You create a new ASPX page in your project, but this page will not return HTML when called by the browser. Instead it will return the image.

In the PageLoad event for this ASPX page you would change the content type that the page returns by setting the Response.ContentType property. You''d load the image, and write the image directly to the Response.Output stream

For example (I''m not sure if you''re doing VB or C#...but this is VB code):

Expand|Select|Wrap|Line Numbers


这篇关于鼠标悬停效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆