473,785 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Start <Div> at bottom of scroll

Ben
I Have a datagrid that i have placed inside a <div> section so that it
becomes scrollable, but now i have a new problem.

I would like the <div> to auto start at the bottom of the scroll (newest
entries are at the bottom).

Can this be done? I dont know any javascripting and everythign i have found
says place the following code as javascript in the html

var objDiv = document.getEle mentById("divEx ample");
objDiv.scrollTo p = objDiv.scrollHe ight;

I guess what im saying is i dont have any javascript in the html and I dont
have any place to call it. I would like to use it when the pane that it is
contained in becomes visible.

Thanks.
Apr 10 '06 #1
3 1937
You need .scrollIntoView methods
http://msdn.microsoft.com/workshop/a...llintoview.asp

"Ben" wrote:
I Have a datagrid that i have placed inside a <div> section so that it
becomes scrollable, but now i have a new problem.

I would like the <div> to auto start at the bottom of the scroll (newest
entries are at the bottom).

Can this be done? I dont know any javascripting and everythign i have found
says place the following code as javascript in the html

var objDiv = document.getEle mentById("divEx ample");
objDiv.scrollTo p = objDiv.scrollHe ight;

I guess what im saying is i dont have any javascript in the html and I dont
have any place to call it. I would like to use it when the pane that it is
contained in becomes visible.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Apr 10 '06 #2
Ben
Michael,

thanks for the reply. That looks like the propertie I am looking for
however, when I type "this." I do not get the <div> control which has the ID
DIVdata. Maybe I am missing something?

Project: ASP.Net Web Forms using Visual Studio 2003

Thanks in advance.
Ben

"Michael Nemtsev" wrote:
You need .scrollIntoView methods
http://msdn.microsoft.com/workshop/a...llintoview.asp

"Ben" wrote:
I Have a datagrid that i have placed inside a <div> section so that it
becomes scrollable, but now i have a new problem.

I would like the <div> to auto start at the bottom of the scroll (newest
entries are at the bottom).

Can this be done? I dont know any javascripting and everythign i have found
says place the following code as javascript in the html

var objDiv = document.getEle mentById("divEx ample");
objDiv.scrollTo p = objDiv.scrollHe ight;

I guess what im saying is i dont have any javascript in the html and I dont
have any place to call it. I would like to use it when the pane that it is
contained in becomes visible.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Apr 10 '06 #3
Put something *at the bottom of the client area* of the div, and call
scrollIntoView on that object.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:5B******** *************** ***********@mic rosoft.com...
Michael,

thanks for the reply. That looks like the propertie I am looking for
however, when I type "this." I do not get the <div> control which has the
ID
DIVdata. Maybe I am missing something?

Project: ASP.Net Web Forms using Visual Studio 2003

Thanks in advance.
Ben

"Michael Nemtsev" wrote:
You need .scrollIntoView methods
http://msdn.microsoft.com/workshop/a...llintoview.asp

"Ben" wrote:
> I Have a datagrid that i have placed inside a <div> section so that it
> becomes scrollable, but now i have a new problem.
>
> I would like the <div> to auto start at the bottom of the scroll
> (newest
> entries are at the bottom).
>
> Can this be done? I dont know any javascripting and everythign i have
> found
> says place the following code as javascript in the html
>
> var objDiv = document.getEle mentById("divEx ample");
> objDiv.scrollTo p = objDiv.scrollHe ight;
>
> I guess what im saying is i dont have any javascript in the html and I
> dont
> have any place to call it. I would like to use it when the pane that
> it is
> contained in becomes visible.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not
cease to be insipid." (c) Friedrich Nietzsche

Apr 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
14467
by: Daniel Hansen | last post by:
I know this must seem totally basic and stupid, but I cannot find any reference that describes how to control the spacing between <p>...</p> and <div>...</div> blocks. When I implement these on a page, there is a huge gap (like 3/8 inch or 25 px) between them. This is driving me bananas. What the hey am I missing? dh ------------------------------------------------ Dan Hansen ------------------------------------------------
4
8214
by: nick | last post by:
The structure is very simple: <div style="WIDTH: 500px; HEIGHT: 50px; BACKGROUND-COLOR: aqua"> <div id="nav"> <a href="#">menu1</a> </div> </div> I want to let the "nav" div sink at the bottom of the aqua color div. I tried to make the "nav" div 100% height and set "vertical-align:
44
919
by: Jim M | last post by:
I have had great success with using <iframe> with overflow-y set to auto. I can get a similar look with the <iframe> tag. BUT... In all cases I need to have fixed heights. Is there a way to put either tag inside an HTML <TD> and have the same kind of scrolling effect. This would allow me to fill the screen and have the size of the scrolling box change on resize. Thanks in advance.
14
12549
by: Simon Wigzell | last post by:
I want to display HTML text inside a div and have the page open scrolled to the bottom. (My div has overflow:auto so that it appears with scroll bars) I have found this that works on a textarea: document.all.MyDivId.scrollTop = document.all.MyDivId].scrollHeight; But this doesn't work on a div. I am using a div because the text I am displaying contains HTML. Surely it is possible to simply set a scroll bar to the bottom in a div???...
2
2072
by: billflu | last post by:
I have a two column table. That looks like this. ____________________ | | | |-----| | | | | | | | | | | |____ |_____________ | Each cell (three total) has a div in it. I am trying to make a dynamic
1
1814
by: drowned | last post by:
I am using div#container and then some more <div>'s inside it. How do I make Mozilla recognize that the container should wrap up everything. I have a div#mainContent, which is right floating inside the div#container and has content that goes below the container. Mozilla doesn't recognize that :( so the content is just floating around unwrapped when you scroll to the bottom of the page. Here is my two <div> elements: #container { ...
0
1699
by: veera venkata | last post by:
hi i am using the following code to provide the zoom,scroll for a image. but this code is working individually either scrolling or zooming. <div onmousemove=zoom_move(event); onmouseover="zoom_on(event,325,407,'<%= strLeftImage %>');" style="FLOAT: left" onmouseout=zoom_off();> <div id="divOuterleft" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; Disable:True PADDING-BOTTOM: 0px; MARGIN: 0px; OVERFLOW: auto; WIDTH: 325px; PADDING-TOP:...
1
2055
by: quangnd412 | last post by:
Hi guys, I want to scroll a DIV. When the DIV scroll the the bottom, it will scroll upward and vice versa. The problem is: When it scroll to the bottom, odivScrollBarStockInfo.scrollTop can not be increased any more but it is still less than odivScrollBarStockInfo.scrollHeight!!! In order to make it work, I have to write a funny code (bold lines). What is the problem here? Please look at this code function _scrollTables() { ...
8
10047
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF editor. A fellow member of the PCG has helped me by creating a bit of Javascript to emulate the scrolling and using Google I've now gotten it into a state where it almost passes the W3C Markup Validation Service. However, the one error, Error Line 166,...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.