Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scrollbars in vbscript

313 views
Skip to first unread message

Marc Bouchard

unread,
Dec 18, 2001, 6:38:43 PM12/18/01
to
Once again, for my login script...

BTW before I post here, I spend an hour searching for answers in search
engines and newsgroups so I hope I'm not bugging people with things that
were already answered.

Now to my question. In my Login Script, I display the status of each task
completed in an HTML page. When it reaches the bottom of the page, a
scrollbar appears. Great! Now, how do I make the page display the last 10
lines instead of the first 10? (keeping the scrollbar at the bottom
basically)

Thanks,

Marc


Michael Harris (MVP)

unread,
Dec 18, 2001, 8:32:15 PM12/18/01
to
Since there are so many ways to add content on the fly, the mechanisn depends a lot on what technique you are currently using.

Here's one that uses an empty span element to control the insertion point as well as to automate scrolling...

set ie = createobject("internetexplorer.application")

ie.toolbar = false
ie.width = 300
ie.height = 300
ie.navigate "about:blank"

do until ie.readyState = 4 : wscript.sleep 10 : loop

with ie.document
.open
.write "<span id='theEnd'></span>"
.close
.title = "test messages"
set theEnd = .all.theEnd
end with

ie.visible = true

for n = 1 to 25
wscript.sleep 100
theEnd.insertAdjacentHtml "beforeBegin", "message line " & n & "<br>"
theEnd.scrollIntoView
next

--
Michael Harris
Microsoft.MVP.Scripting

"Marc Bouchard" <mbou...@internet.look.ca> wrote in message news:OfNT71BiBHA.1920@tkmsftngp04...

Marc Bouchard

unread,
Dec 18, 2001, 9:38:02 PM12/18/01
to
Right on! :) I really wish I knew where to find all this information... Are
there any good books or websites or anything you could recommend to find
these things? I have a good knowledge of programming structures and all, and
I can figure out pretty much everything by looking at the vbs codes, but
when it comes to objects and their properties etc, I have no clue where to
find what and how to call them.

Thanks!

Marc

"Michael Harris (MVP)" <mik...@mvps.org> wrote in message
news:eNHaV0CiBHA.2132@tkmsftngp07...

Michael Harris (MVP)

unread,
Dec 18, 2001, 10:17:59 PM12/18/01
to
The best resource is the documentation.

SDK Documentation [HTML and Dynamic HTML]
http://msdn.microsoft.com/workshop/author/dhtml/dhtml_node_entry.asp

In the beginning it's a lot like moving to a foreign country where you don't know the language or the lay of the land. You spend a lot of time getting lost, heading down blind alleys, constantly looking up things in you phrase book, ...

Eventually light bulbs start going off and you get that great "Eureka!" feeling ;-)...

As for books, I'm somewhat biased toward titles from Wrox Press (www.wrox.com). They have always helped paint the big picture for me.

One title in particular I found extremely useful was Wrox.com - Programmer to Programmer http://www.wrox.com/Books/Book_Details.asp?isbn=1861001746.

--
Michael Harris
Microsoft.MVP.Scripting

"Marc Bouchard" <mbou...@internet.look.ca> wrote in message news:uOXoMaDiBHA.2212@tkmsftngp05...

Evertjan.

unread,
Dec 19, 2001, 11:44:51 AM12/19/01
to

Why not just open the page with an anchor
<a name="theverybottom"></a>
at the bottom:

href="mypage.asp#theverybottom"

As the page completes, the bottom will be shown.

===========

Or do you want the intermediate (flushed) result to be at the bottom?

Clientside: SetTimeout(ScrollTo(1000,0),........??

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Marc Bouchard

unread,
Dec 19, 2001, 12:34:02 PM12/19/01
to
Michael Harris's solution is exactly what I was looking for. :) Try his code
sample to see the result I wanted.

Thanks for your time!

Marc

"Evertjan." <exjxw.ha...@interxnl.net> wrote in message
news:Xns917CB489...@194.109.6.74...

0 new messages