Discussion:
event on div
Boštjan Jerko
2009-01-29 21:23:09 UTC
Permalink
Hello!

I'd like to link a function (to scroll the data) to a div I have.
The page is made out of two divs:
<div class="left">
.....
</div>
<div class="right">
.....
</div>

Now I'd like to link a script to div with class="left" and do
scrolling only in that div.
Scrolling is already solved using MochiKit.Visual.ScrollTo, but I
don't know how to use it only in one div.


B.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---
Per Cederberg
2009-01-29 22:13:43 UTC
Permalink
Don't understand your question I'm afraid... Are you looking for
style="overflow: auto;"? Or MochiKit.Selector.$$("div.left")???

Cheers,

/Per
Post by Boštjan Jerko
Hello!
I'd like to link a function (to scroll the data) to a div I have.
<div class="left">
.....
</div>
<div class="right">
.....
</div>
Now I'd like to link a script to div with class="left" and do
scrolling only in that div.
Scrolling is already solved using MochiKit.Visual.ScrollTo, but I
don't know how to use it only in one div.
B.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---
Boštjan Jerko
2009-01-30 07:28:28 UTC
Permalink
I am looking for a way to automatically scroll class left to selected
id:
<div class="left">
<a html="link1" id="link1">...</a><br/>
<a html="link2" id="link2">...</a><br/>
<a html="link3" id="link3">...</a><br/>
<a html="link4" id="link4">...</a><br/>
</div>

Now I'd like to scroll for example to id="link3".

Usualy this is done with adding onLoad to body tag, but that way you
scroll the whole window. I'd like to scroll only the left part.

B.
Post by Per Cederberg
Don't understand your question I'm afraid... Are you looking for
style="overflow: auto;"? Or MochiKit.Selector.$$("div.left")???
Cheers,
/Per
Post by Boštjan Jerko
Hello!
I'd like to link a function (to scroll the data) to a div I have.
<div class="left">
.....
</div>
<div class="right">
.....
</div>
Now I'd like to link a script to div with class="left" and do
scrolling only in that div.
Scrolling is already solved using MochiKit.Visual.ScrollTo, but I
don't know how to use it only in one div.
B.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---
Per Cederberg
2009-01-30 10:15:31 UTC
Permalink
Ok, this isn't really MochiKit-related, but define your CSS class as follows:

.left {
overflow-y: auto;
height: 100%; /* or some fixed pixel value */
}

Try it with a static page first.

Cheers,

/Per
Post by Boštjan Jerko
I am looking for a way to automatically scroll class left to selected
<div class="left">
<a html="link1" id="link1">...</a><br/>
<a html="link2" id="link2">...</a><br/>
<a html="link3" id="link3">...</a><br/>
<a html="link4" id="link4">...</a><br/>
</div>
Now I'd like to scroll for example to id="link3".
Usualy this is done with adding onLoad to body tag, but that way you
scroll the whole window. I'd like to scroll only the left part.
B.
Post by Per Cederberg
Don't understand your question I'm afraid... Are you looking for
style="overflow: auto;"? Or MochiKit.Selector.$$("div.left")???
Cheers,
/Per
Post by Boštjan Jerko
Hello!
I'd like to link a function (to scroll the data) to a div I have.
<div class="left">
.....
</div>
<div class="right">
.....
</div>
Now I'd like to link a script to div with class="left" and do
scrolling only in that div.
Scrolling is already solved using MochiKit.Visual.ScrollTo, but I
don't know how to use it only in one div.
B.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---
Boštjan Jerko
2009-01-30 12:57:12 UTC
Permalink
Post by Per Cederberg
.left {
overflow-y: auto;
height: 100%; /* or some fixed pixel value */
}
Try it with a static page first.
Cheers,
/Per
I already have that for a manual scroll. I want to do it
"automaticaly".
As stated before - the scroll works perfectly on the whole page, but
I'd like to do it only in the div part of the page.

MochiKit documentation says to use addLoadEvent, but I don't know how
to connect it with <div class="left">.

B.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---
Per Cederberg
2009-01-30 13:40:43 UTC
Permalink
var elem = $$("div.left a.link3");

/Per
Post by Boštjan Jerko
Post by Per Cederberg
.left {
overflow-y: auto;
height: 100%; /* or some fixed pixel value */
}
Try it with a static page first.
Cheers,
/Per
I already have that for a manual scroll. I want to do it
"automaticaly".
As stated before - the scroll works perfectly on the whole page, but
I'd like to do it only in the div part of the page.
MochiKit documentation says to use addLoadEvent, but I don't know how
to connect it with <div class="left">.
B.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...