PDA

View Full Version : Text Box scrolling - how did they do it???



danl linehan
Mar 18th, 2009, 04:15 PM
a client sent me this link and said they would like to incorporate it into their page, but i am lost...

please look at this site and notice the "up" and "down" arrows...

http://www.ascoconstruction.co.uk/services.php

i have been looking at the code but just can't figure out how they've accomplished this... any help would be SO appreciated... thank you so much!!!

BoldUlysses
Mar 18th, 2009, 04:23 PM
Those are JavaScript scroll areas. Link here (http://n-son.com/scripts/jsScrolling/).

danl linehan
Mar 19th, 2009, 05:50 AM
that was exactly what i was looking for... now, i'm not a super genius when it comes to css & javascript, so (of course) i'm having some problems... i added this to my page, altering only the coordinates of text boxes and the up & down buttons... everything lines up pretty much where i want it to... but there is a hitch: it doesn't scroll!!! i don't know what i've done wrong... i've gone through it over and over looking for mistakes, but i can't catch any... now, again, i'm not incredibly skilled at this sort of stuff, but i've spent hours and hours looking for this problem... if anyone has the time and generosity to take a look at it, any help would be amazing...

www.revolutionfreedom.com/clients/buffett

(it's the "news" section running down the middle of the page)

thank you so much...

danl linehan
Mar 19th, 2009, 03:58 PM
ok, it's working in IE, but not in firefox... any thoughts???

danl linehan
Mar 20th, 2009, 03:04 PM
*bump*

okay, so the scrolling is working just fine in IE and the AOL browser, but not firefox or safari...

the link that you sent me above:

http://n-son.com/scripts/jsScrolling/new/example1.html

works fine in all of those... i'm not sure what i'm missing... any help would be greatly appreciated... thank you so much.

VIPStephan
Mar 20th, 2009, 03:14 PM
Uhm, well… I’m currently looking at http://revolutionfreedom.com/clients/buffett/ and apart from this being terrible code I can’t see any JavaScript in there that would even remotely induce the scrolling. Where is the JS?

Ah sorry, I’ve overseen the iframe there. So, would you mind scrapping all the old, deprecated tags such as <center> and <font> and actually just copying the example page and building upon that step by step? It would be easier to spot where it stops working then.

danl linehan
Mar 23rd, 2009, 05:37 AM
i realize that i may not be the sharpest coder out there (heck, i've never even had any sort of education in any of it), but i don't think that my code is TERRIBLE (it's always been enough to get me by)... i'm just trying to learn something new and running into stumbling blocks...

anyway, i've checked my javascript with firebug, but turn up nothing wrong...

again, the page works fine in IE and AOL/netscape, but not in firefox or safari...

any help or recommendations would be wonderful... thank you!!!

www.revolutionfreedom.com/clients/buffett/index.html
which contains www.revolutionfreedom.com/clients/buffett/news.html

p.s. sorry for using <center>

oesxyl
Mar 23rd, 2009, 05:57 AM
i realize that i may not be the sharpest coder out there (heck, i've never even had any sort of education in any of it), but i don't think that my code is TERRIBLE (it's always been enough to get me by)... i'm just trying to learn something new and running into stumbling blocks...

anyway, i've checked my javascript with firebug, but turn up nothing wrong...

again, the page works fine in IE and AOL/netscape, but not in firefox or safari...

any help or recommendations would be wonderful... thank you!!!

www.revolutionfreedom.com/clients/buffett/index.html
which contains www.revolutionfreedom.com/clients/buffett/news.html

p.s. sorry for using <center>

why do you define onScrollStart and onScrollStop twice?
try to remove this part:


this.onScrollStart = function (){};
this.onScrollStop = function (){};


best regards

TinyScript
Mar 23rd, 2009, 06:08 AM
Here's the code from the link you posted



<div id="vifdiv" style="position:absolute; left:490px; top:263px; z-index:0">
<table border="0" cellpadding="0" cellspacing="0" width="285">

<tr><td>
<iframe name="vif" width="285" height="155" src="./services_body.php" scrolling="no" frameborder="0"></iframe>
</td><td align="center" valign="middle" width="22">
<img src="greyup.gif" alt="Up" title="Up" border=0 vspace="5" hspace="3"
onMouseDown="esh_vif();bsh_vif(-3,2)"
onMouseUp="esh_vif();bsh_vif(-1,20)"
onMouseOver="bsh_vif(-1,20)"
onMouseOut="esh_vif()"><br>
<img src="greydown.gif" alt="Down" title="Down" border=0 vspace="5" hspace="3"
onMouseDown="esh_vif();bsh_vif(3,2)"
onMouseUp="esh_vif();bsh_vif(1,20)"
onMouseOver="bsh_vif(1,20)"
onMouseOut="esh_vif()">

<script type="text/javascript" language="javascript">
function bsh_vif(step,time){hs_vif=setInterval("sh_vif("+step+")",time)}
function esh_vif(){clearInterval(hs_vif)}
function sh_vif(step)
{
scrollx=vif.document.body.scrollLeft
scrolly=vif.document.body.scrollTop
scrolly=scrolly+step
vif.window.scroll(scrollx,scrolly)
}
</script>
</td></tr></table></div>



just put you list in an html file and change the php address. Actually it works locally with the php file anyway, just save it. But a plain old html will do fine too

danl linehan
Mar 23rd, 2009, 06:33 AM
why do you define onScrollStart and onScrollStop twice?
try to remove this part:


this.onScrollStart = function (){};
this.onScrollStop = function (){};


best regards

i only see it defined once in variables section:



public variables
this.onScrollStart = function (){};
this.onScrollStop = function (){};
this.onScroll = function (){};
this.scrollSpeed = 30;


and if i remove those, how can they be called with the this.startScroll = function and this.stopScroll = function

danl linehan
Mar 23rd, 2009, 06:36 AM
just put you list in an html file and change the php address. Actually it works locally with the php file anyway, just save it. But a plain old html will do fine too

i don't know what script that is... and i really don't understand your reply... can you explain? thank you!

EDIT:
oh, you were referring to the original link (the Asco site)... sorry, i was confused...

oesxyl
Mar 23rd, 2009, 06:47 AM
i only see it defined once in variables section:



public variables
this.onScrollStart = function (){};
this.onScrollStop = function (){};
this.onScroll = function (){};
this.scrollSpeed = 30;


and if i remove those, how can they be called with the this.startScroll = function and this.stopScroll = function
yes, you are right. I don't understand what I see when I said that, :)

best regards

danl linehan
Mar 23rd, 2009, 06:51 AM
i would think that i'm doing something wrong if it didn't work anywhere at all, but the fact that it is working in IE at all has me totally puzzled... especially since the example (http://n-son.com/scripts/jsScrolling/new/example1.html) works in firefox just fine...

could it, by any chance, have something to do with the fact that the page is in an iframe???

oesxyl
Mar 23rd, 2009, 07:01 AM
i would think that i'm doing something wrong if it didn't work anywhere at all, but the fact that it is working in IE at all has me totally puzzled... especially since the example (http://n-son.com/scripts/jsScrolling/new/example1.html) works in firefox just fine...

could it, by any chance, have something to do with the fact that the page is in an iframe???
the page from this link don't work for me in ffox 2.0, and have no js error in firebug.
If someone else can test it maybe this is the problem.

PS: the code from the link from your post #1 work for me.

best regards

danl linehan
Mar 23rd, 2009, 03:12 PM
i'm using firefox 3.0.7 and it works... also, i used firebug on my pages and turned up nothing wrong...

danl linehan
Mar 24th, 2009, 10:08 PM
still stumped on this one, so bumping it up... thanks!