The Entreprexplorer's Journal

A journal of one (currently young) man's journey into entrepreneurism. Including entrepreneurial thoughts, ideas, tribulations, experiences, etc. See where it goes...


  Subscribe to this blog!

My Photo
Name:
Location: San Francisco, California, United States

I am an entrepreneur based in San Francisco, CA. My current entrepenurial project is CommunityWalk.com.

Monday, August 08, 2005

A little javascript

So I've recently been using divs with scrollbars in my web development a lot. They make for a handy means of putting what ever you want in a scrollable area. One of the better usages I have done is for pictures, where one larger picture is displayed and a number of thumbnails are displayed directly underneath. You can see a sample of this at the CommunityWalk demo (http://demo.communitywalk.com/demo/group?id=1) by clicking on the photos link on any of the markers.

Well when the user uses the plus or minus buttons to scroll through the pictures the thumbnails will become out of sync, so that the thumbnail of the larger photo is actually hidden in the non-viewable area of the div. (This is getting a little hairy to explain. I aplogize.) In any case I developed a little javascript last night that allows to make sure that an object that is contained by another object is displayed. So in this example you could be sure that the thumbnail for the larger picture is always displayed.

Well the js is right here:

http://gmaps.yellowbkpk.com/jared/visible.js

There are no licenses or anything attached to it, use it as you please. There also is not much in the way of documentation :) so use it at your own risk.

The main function allows someone to ensure that one object is visible within the constraints of a containing object. In the example above this ensures that the thumbnail image objects are viewable without moving the scroll bar on the div.

Again I apologizes for the lack of further explanation, instructions or clarifications, but I am very tired now... If you need help with it just drop me an email and I'll help ya out.

0 Comments:

Post a Comment

<< Home