如何从div上滑动文本? [英] How to slide text from on div ?

查看:73
本文介绍了如何从div上滑动文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用4格.一个用于图像,其余3个用于文本.
一次只在div上可见.我需要知道如何也获取与div对应的文本.

实际上,我是第一个使用javascript的人.所以我不知道如何在同一个div上滑动文本.

我已经写了一个代码.我正在粘贴此代码.如果您可以帮助我..pls ......


I have used 4 div .one for image ,rest 3 for text .
only visble on div at a time .I need to knw how to get the text corresponding to div also .

Actully i am first to use javascript .so i dnt knw how to slide text on same div.

I have written a code .I am pasting this code along with this .If u can help me ..pls ......


<html>
<Head>
<meta http-equiv='Content-Type' content='text/html;  charset=x-user-defined'>
</Head>

<body style='background-color:white' topmargin=0 leftmargin=0> onload= firstSlide();>

<style type='Text/css'>
div#divMarq  (z-index: 0;position: absolute;)
div#divMarq1  (z-index: 0;position: absolute;)
div#divMarq2  (z-index: 0;position: absolute;)
div#divimglogo ( z-index: 1;position: absolute;left:0;top:0 )
</style>

<script type='Text/javascript'></script>

<DIV ID='divimglogo' style='position:absolute; top:0px; left:0px;width:800px;height:20px;

background-color:Window;'></DIV>

<DIV ID='divMarq' STYLE='visibility:visible;position:absolute;top:0;left:5

;color:#FF8000;width:800px;height:94px;overflow:hidden;opacity:1; border:0px solid  WRAP=OFF'>
<span style="font-family:Microsoft Sans Serif ;font-size: 8.25 pt; color :Black;">
45 645 656 56546456

456456</span></DIV>


<DIV ID='divMarq1' STYLE='visibility:visible;position:absolute;top:25;left:10

;color:#FF8000;width:539px;height:94px;overflow:hidden;opacity:1; border:0px solid  WRAP=OFF'> </DIV>



<script type='text/javascript' language='javascript'></script></span><span style="font-family:Microsoft

Sans Serif ;font-size: 8.25 pt; color :Black;">
tryrty rtyrrtr </span></DIV>

<DIV ID='divMarq2' STYLE='visibility:visible;position:absolute;top:40;left:10

;color:#FF8000;width:539px;height:94px;overflow:hidden;opacity:1; border:0px solid  WRAP=OFF'>

</span><span style="font-family:Microsoft Sans Serif ;font-size: 8.25 pt; color

:Black;">456546</span></DIV>

<SCRIPT>
var slideArray = new Array();
var slide1='tt ryrtyyt ry rty rty'
var slide2='4355435543555345'
function firstSlide()
{
slideArray[0]=slide1;

document.getElementById('divMarq1').innerHTML=slideArray[0];
setTimeout('secondSlide()',100);
}
function secondSlide()
{slideArray[1]=slide2;
document.getElementById('divMarq2').innerHTML=slideArray[1];
setTimeout('firstSlide()',100);}
</SCRIPT>

 </body>

</html>

推荐答案

在这里看看, http://jqueryui.com /demos/effect/ [ ^ ]

另外,为div使用CSS,然后为它们使用内联样式,也没有意义,尤其是当样式复制CSS时.
Have a look here, http://jqueryui.com/demos/effect/[^]

Also, it makes no sense to have CSS for the divs, then use in-line styles for them, particularly when the styles duplicate the CSS.


这篇关于如何从div上滑动文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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