Div滚动鼠标滚动 [英] Div Scroll on MouseOver

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

问题描述




我在div标签中使用菜单。我想要做的是沿着div添加滚动按钮(向上和向下),鼠标上下移动div。我怎样才能实现这个目标?


这将是非常好,如果你能提供链接到文章或博客,为我的问题提供解决方案。


提前谢谢,

Saad Alam

解决方案


我在div标签内使用菜单。我想要做的是沿着div添加滚动按钮(向上和向下),鼠标悬停上下移动div。



如果可以这样做,可能需要使用iFrame而不是div标签。据我所知div标签不使用滚动条。只要内容比iFrame的尺寸更长或更宽,IFrame标签就会有滚动条。


您必须检查DOM引用以查看是否有任何属性可以设置修改滚动位置。


嗨...


你可以玩div'的溢出样式属性..看看下面这个简单的例子......当鼠标移动到自定义滚动控件上时滚动div:

展开 | 选择 | 换行 | 行号



嗨...


你可以玩div'的溢出风格属性...看看下面的简单示例...在自定义滚动控件上移动鼠标时滚动div:

展开 | 选择 | 换行 | 行号


Hi,

I am using a menu inside a div tag. What i want to do is to add scroll buttons (up and down ) along side div which move the div up and down on mouse over.How can i achieve this?

It would be very nice of you if you can provide a link to the article or blog where solution is provided to my problem.

Thanks in advance,
Saad Alam

解决方案

I am using a menu inside a div tag. What i want to do is to add scroll buttons (up and down ) along side div which move the div up and down on mouse over.

If that can be done it would likely have to be done with an iFrame instead of a div tag. As far as I know div tags do not use scroll bars. IFrame tags will have scroll bars any time their content is longer or wider than the the dimensions of the iFrame.

You would have to check the DOM references to see if there are any attributes you can set to modify the scroll position.


hi ...

you might play with the div''s overflow style-property ... have a look at the following simple example ... that scrolls a div when moving the mouse over custom scroll-controls:

Expand|Select|Wrap|Line Numbers


hi ...

you might play with the div''s overflow style-property ... have a look at the following simple example ... that scrolls a div when moving the mouse over custom scroll-controls:

Expand|Select|Wrap|Line Numbers


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

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