开发者

Dynamically moving div, like Yelp's moving map

开发者 https://www.devze.com 2022-12-30 09:22 出处:网络
I am tryi开发者_如何学Cng to implement something very similar to Yelp\'s moving map.See: http://www.yelp.com/search?find_desc=restaurants&ns=1&find_loc=mountain+view%2C+ca

I am tryi开发者_如何学Cng to implement something very similar to Yelp's moving map. See:

http://www.yelp.com/search?find_desc=restaurants&ns=1&find_loc=mountain+view%2C+ca

Basically it starts off somewhere in the middle of the page, but if you scroll down far enough that you wouldn't be able to see it, it moves down as well. What is the best way to do this in javascript? My app is in GWT, but I think I will have to use native js to achieve this effect.

Thanks, Jean


you need some sort of a scroll event handler. either register body.onscroll yourself or use a pre-existing component in any of a number of javascript frameworks. Google 'javascript scroll event' and you'll find plenty

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号