Base2 JSB scroll event

12 views
Skip to first unread message

Marijn

unread,
Oct 24, 2010, 8:27:26 AM10/24/10
to base2-js
Hi everyone,

Long time no see!

Well, I've been working a lot with base2 on a broad range of projects
lately and it has proven itself in production more than a few times
lately.
Especially combined with the Animator.js library from Berniecode
(http://berniecode.com/writing/animator.html) it produces really
modular extensions.

Anyway, I just dropped by because I have two questions

1) What's up with base2 2.0. Is there some alpha stuff available ? I
would love to toy with it in my playground ;-)
2) How to bind JSB to the window scroll event...? I looked for it in
chrome as well but I couldn't find any reference by browsing the
code...

Again, thanks for this awesome library.

Kindest regards,

Marijn

Dean Edwards

unread,
Oct 28, 2010, 3:15:57 PM10/28/10
to base...@googlegroups.com, Marijn
On 24/10/2010 13:27, Marijn wrote:
>
> Well, I've been working a lot with base2 on a broad range of projects
> lately and it has proven itself in production more than a few times
> lately.
> Especially combined with the Animator.js library from Berniecode
> (http://berniecode.com/writing/animator.html) it produces really
> modular extensions.
>
> Anyway, I just dropped by because I have two questions
>
> 1) What's up with base2 2.0. Is there some alpha stuff available ? I
> would love to toy with it in my playground ;-)

I keep tweaking version 2.0. I haven't changed it much lately so I'm,
starting to think that it is ready for release.

> 2) How to bind JSB to the window scroll event...? I looked for it in
> chrome as well but I couldn't find any reference by browsing the
> code...
>

You can't bind to the window scroll event declaratively, you will have
to addEventListener in the onattach event. I might add onviewportscroll
now that you have mentioned it.

-dean

Marijn

unread,
Oct 28, 2010, 3:57:52 PM10/28/10
to base2-js
Ok, I take it that is cross browser compatible :-)

I've added a gist for future reference: http://gist.github.com/652204

> I might add onviewportscroll now that you have mentioned it.

That would be totally awesome!

> -dean

Dean Edwards

unread,
Oct 29, 2010, 3:52:16 PM10/29/10
to base...@googlegroups.com
On 28/10/2010 20:57, Marijn wrote:
>> You can't bind to the window scroll event declaratively, you will have
>> to addEventListener in the onattach event.
>
> Ok, I take it that is cross browser compatible :-)
>
> I've added a gist for future reference: http://gist.github.com/652204

Yes, that's it. It will be cross-browser compatible because JSB is built
on top of base2.

>> I might add onviewportscroll now that you have mentioned it.
>
> That would be totally awesome!
>

Yeah, I thought about this for a while. I'm also thinking that I should
add ontextresize for text zooming. Any other global events that I should
add?

-dean

d. mitchell austin

unread,
Oct 30, 2010, 1:15:46 PM10/30/10
to base...@googlegroups.com
On Fri, Oct 29, 2010 at 2:52 PM, Dean Edwards <dean.e...@gmail.com> wrote:
> Yeah, I thought about this for a while. I'm also thinking that I should add
> ontextresize for text zooming. Any other global events that I should add?

I like the idea of an ontextresize. I've been wondering about onhashchange.
--
m

Dean Edwards

unread,
Oct 30, 2010, 3:37:05 PM10/30/10
to base...@googlegroups.com
On 30/10/2010 18:15, d. mitchell austin wrote:

> On Fri, Oct 29, 2010 at 2:52 PM, Dean Edwards wrote:
>> Yeah, I thought about this for a while. I'm also thinking that I should add
>> ontextresize for text zooming. Any other global events that I should add?
>
> I like the idea of an ontextresize. I've been wondering about onhashchange.
> --

How about these?

1. onwindowresize
2. onwindowscroll
3. ontextresize
4. onhashchange

We already have ondocumentready.

The last one might not be possible in IE6 without inserting an <iframe>.

-dean

Marijn

unread,
Nov 4, 2010, 6:21:50 AM11/4/10
to base2-js
On Oct 30, 8:37 pm, Dean Edwards <dean.edwa...@gmail.com> wrote:
> On 30/10/2010 18:15, d. mitchell austin wrote:
>
> > On Fri, Oct 29, 2010 at 2:52 PM, Dean Edwards wrote:
> >> Yeah, I thought about this for a while. I'm also thinking that I should add
> >> ontextresize for text zooming. Any other global events that I should add?
>
> > I like the idea of an ontextresize. I've been wondering about onhashchange.
> > --
>
> How about these?
>
> 1. onwindowresize
> 2. onwindowscroll
> 3. ontextresize
> 4. onhashchange

Yes, yes, yes!

> We already have ondocumentready.
>
> The last one might not be possible in IE6 without inserting an <iframe>.

Just out of curiosity? Why would that need an iframe?

> -dean

Dean Edwards

unread,
Nov 4, 2010, 4:17:46 PM11/4/10
to base...@googlegroups.com
On 04/11/2010 10:21, Marijn wrote:
> On Oct 30, 8:37 pm, Dean Edwards<dean.edwa...@gmail.com> wrote:
>> On 30/10/2010 18:15, d. mitchell austin wrote:
>>
>>> On Fri, Oct 29, 2010 at 2:52 PM, Dean Edwards wrote:
>>
>> How about these?
>>
>> 1. onwindowresize
>> 2. onwindowscroll
>> 3. ontextresize
>> 4. onhashchange
>
> Yes, yes, yes!
>>
>> The last one might not be possible in IE6 without inserting an <iframe>.
>
> Just out of curiosity? Why would that need an iframe?
>

IIRC, you can't detect hash changes with back/forward buttons otherwise.

-dean

Reply all
Reply to author
Forward
0 new messages