在asp.net中滚动的字幕问题 [英] Marquee problem for scrolling in asp.net

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

问题描述

我在页脚的母版页中使用了选取框,以通过数据列表视图控件向客户显示徽标图像,该效果很好,也就是在我编写的选取框控件中:

I have use marquee in master page in footer for show clients logo image through datalist view controls that is working fine and that is in Marquee control I have written :

marquee id="myMarquee" direction="left" behavior="scroll" scrollamount="5" truespeed="truespeed" loop="-1" scrolldely="100" onmouseover="this.stop()" onmouseout="this.start()"


这是可行的,但我想当我拖动左侧或右侧的鼠标而不是更改滚动方向并快速滚动时.

例如,我要执行以下操作:http://www.Innovation.com.链接u可以看到页脚部分..


This is working but I want to when I drag mouse of left side or right side than scrolling direction changed and speedy scroll.

for example i want to do same as : http://www.Innovation.com . link u can see footer part..

推荐答案

这并不完美,但我希望它能给您一些想法.在我的解决方案中,您不会拖动,而只能在选框上向左或向右移动鼠标.检测速度和方向,并调整选取框以反映左右滚动以及一定程度的速度.
您可能必须尝试计算延迟和速度.

这是示例:

This is not perfect, but I hope it will give you some ideas. In my solution you don''t drag but only move the mouse left or right over the marquee. Speed and direction are detected and the marquee is adjusted to reflect left and right scrolling and also the speed to some extent.
You''ll probably have to play around with the calculation of the delay and the speed.

Here''s the sample:

<html>
<body>
X <input id="X" style="width: 2em;"/> Y <input id="Y" style="width: 2em;"/></br>
<div style="width: 4em; float:left;">Direction</div><input id="direction" style="width: 2em;"/></br>
<div style="width: 4em; float:left;">Speed</div><input id="speed" style="width: 2em;" value=""/></br>
<div style="width: 4em; float:left;">Delay</div><input id="delay" style="width: 2em;" value=""/></br>
<marquee id="myMarquee"

         direction="left"

         behavior="scroll"

         scrollamount="2"

         scrolldelay="100"

         onmouseover="mouseOver(this);"

         onmouseout="mouseOut(this);"

         onmousemove="mouseMove(this);"

         style="height: 4em; border: 2px solid red; background-color: #DDDD55; align: middle;">
    <span style="font-size: 2.0em;">This text will be scrolled left or right depending on the direction you move the mouse. Enjoy!</span>
</marquee>
<script type="text/javascript">
var mx;
var my;
var direction;
var speed;
function mouseOver(me)
{
    me.stop();
    var e = window.event;
    mx = e.clientX;
    my = e.clientY;
}

function mouseOut(me)
{
    me.start();
    mx = -1;
    my = -1;
}

function mouseMove(me)
{
    var e = window.event;
    var x = e.clientX;
    var y = e.clientY;
    if(isNaN(mx) || isNaN(my))
    {
        mx = x; my = y;
        return;
    }
    var delta = x-mx;
    direction = (delta)>0 ? 1:-1;
    speed = delta<0 ? -delta : delta;

    mx = x; my = y;

    var sxEle = document.getElementById("X");

    var syEle = document.getElementById("Y");

    var directionEle = document.getElementById("direction");

    var speedEle = document.getElementById("speed");

    var delayEle = document.getElementById("delay");

    sxEle.value=mx;

    syEle.value=my;

    directionEle.value=direction;



    me.direction = direction>0 ? "right" : "left";
    me.scrollAmount = speed;
    var mqDelay = 100 - speed*10*4;
    mqDelay = mqDelay<0 ? 1 : mqDelay;

    me.scrollDelay = mqDelay;

    speedEle.value = speed;

    delayEle.value = mqDelay;

    me.start();

}



</script>
</body>
</html>



问候



Regards,


这篇关于在asp.net中滚动的字幕问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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