PDA

View Full Version : help me



cheikhanio
03-30-2008, 08:37 PM
plz i want put this text in form with timer
the text will ve mouve
thinks so much

Barbarossa
03-31-2008, 08:44 AM
eh? :blink:

Snee
03-31-2008, 02:31 PM
I think he wants a .js wot makes text scroll.

I'm mostly guessing, though.



<!doctype html public "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>
<head>
<title>Status Bar</title>
<script type="text/javascript" language="JavaScript">

window.status = "Something's supposed to happen here.";

var scrolltext = "";
var del1 = "";
var del2 = "";
var timerID;
var raknare = 0;
var scrollstatus = false;

function scrolla()
{
if (scrollstatus)
{
scrolltext = document.Formular.nyText.value;
del1 = scrolltext.substring(raknare, scrolltext.length) + " ";
del2 = scrolltext.substring(0, raknare);
window.status = del1 + del2;
(raknare < 0) ? raknare = scrolltext.length : raknare--;
timerID = setTimeout("scrolla()", 100);
}
}


function startaScroll()
{
scrollstatus = true;
scrolla();
}

function stoppaScroll()
{
clearTimeout(timerID);
scrollstatus = false;
}

</script>
</head>
<body bgcolor="white">
<form action="#" name="Formular">
<input type="button" onclick="startaScroll();" value="Faster faster!">
<input type="text" name="nyText" size="100" value="Write some text you'd like to move, here. ">
<input type="button" onclick="stoppaScroll();" value="Stop">
</form>
</body>
</html>


Here's some old thing I wrote to scroll text in the status bar.

Probably won't run in FF with default settings as FF tends to block that kind of thing, run it in ie to test it or stick the text in an input field, it should be easy enough.

And no, I won't translate the variable names and that to english.

here's how to do it in the other direction:



function scrolla()
{
if (scrollstatus)
{
scrolltext = document.Formular.nyText.value;
del1 = scrolltext.substring(raknare, scrolltext.length) + " ";
del2 = scrolltext.substring(0, raknare);
window.status = del1 + del2;
(raknare > scrolltext.length) ? raknare = 0 : raknare++;
timerID = setTimeout("scrolla()", 100);
}
}


In case the logic seems dodgy to you.

EDit: or just use those crap marquee-tags (http://www.scit.wlv.ac.uk/encyc/marquee.html), though they are a bit shit and not supported by the w3c-standard.

cheikhanio
04-03-2008, 03:05 PM
tkinks so mutch (http://filesharingtalk.com/vb3/../members/snee-45773)
Snee (http://filesharingtalk.com/vb3/../members/snee-45773)
plz
if u can exlpain with vb.net.
i'm working with vb.net

i6q
04-03-2008, 09:34 PM
http://www.google.co.uk/search?q=vb.net+to+c&ie=utf-8&oe=utf-8&aq=t&rls=com.google:en-US:official&client=firefox-a

Snee
04-05-2008, 02:24 AM
tkinks so mutch (http://filesharingtalk.com/vb3/../members/snee-45773)
Snee (http://filesharingtalk.com/vb3/../members/snee-45773)
plz
if u can exlpain with vb.net.
i'm working with vb.net

I'm sorry, I forgot to check up on this thread.

If you are coding in asp.net using vb.net, you might be able to just use that .js almost as it is. If you need to import the text from a database that may be doable with scrolling text with that javascript via an input field set as runat="server".

If you need to do the whole thing in VB-code, that's a bit trickier. Never had to do that, and VB's most certainly not my language of choice, so I'd rather not.

Checking the internet, there are some variants people have written that may be of help.

Here's one. (http://www.devarticles.com/c/a/VB.Net/Building-a-News-Ticker-Using-VB.Net/)

Googling "vb.net scrolling text (http://www.google.co.uk/search?hl=sv&client=firefox-a&rls=com.google%3Aen-US%3Aohmy%3Afficial&hs=bfI&q=vb.net+scrolling+text&btnG=S%C3%B6k&meta=)" turned a few things up.

cheikhanio
04-05-2008, 10:34 PM
ok thinks very mutch Snee (http://filesharingtalk.com/vb3/../members/snee-45773)