2010-08-01
Main Menu
external Links
Most Read
Support

If you like the products on these pages, your support is highly appreciated. Thank you very much!

Amount: 

Javascript: lake
Written by Andreas Berger   
Saturday, 19 April 2008 07:48

bretteleben.de JavaScript Lake - Updated 20081207!

The JavaScript "lake" results from my attempt to replace a - used with a former version of my private homepage - Java Applet from David Griffith with JavaScript.

Because i was not able to find such a script - i decided to write one on my one.

Display:

The result is not exactly what i wanted to achieve and does not reach the original, but it offers at least similar functionality. One may ripple the lower part of a picture, mirror the upper part of the image about a virtual waterline, underlay a second picture to shimmer through the water or overlay the picture with a - partial transparent - picture.

Functionality:

To simulate a waved surface, the affected part of the image is divided in slices with a height of 1 pixel. This is done, using the css feature clip:rect, which leaves visible only a certain part of a div-container.
These slices get - following a curve - deflected to the left and the right and this way create the illusion of moving waves.
Thanks to two FOR-loops this is done with only a few lines of code.

Installation and Configuration:

The integration into the web page and the configuration of the parameters is illustrated in detail on the following four sample pages:

Lakescript Sample 01 - standard configuration
Lakescript Sample 02 - mirroring the upper part of the image
Lakescript Sample 03 - mirroring the upper part of the image plus using an underlay
Lakescript Sample 04 - using an overlay

Demo:

Sample (displayed within an iframe):

Browser-compatibility:

The JavaScript is till now tested as follows:

 WindowsMac OSXLinuxFreeBSD
MSIE Internet Explorer
6    
MSIE Internet Explorer 7.0J   
MSIE Internet Explorer 8    
FireFox Firefox
2.0.0.16J   
FireFox Firefox
3.0.1J   
Opera Opera
9.25J   
Safari Safari
3.11J   

License

The script is licensed under the GNU Public License (www.gnu.org/copyleft/gpl.html).

update Version: 20081207

Version 20081207

- absolute positioning is no more required
- License for further Releases GNU/GPL
- 4 Sample-Pages online
- now works proper with a Doctype-Declaration

Version 20080501

Miscellaneous

I am happy about everybody who gives me a link back to www.bretteleben.de on his website, this way helping me to popularize the script. The JavaScript "lake" is till now listed in different JavaScript - resources, including the largest - as far as i know - JavaScript resource: HotScripts.

If you have questions or suggestions about this JavaScript, please use the comment-function. Records about the behavior of this script with further browsers/operating systems would be appreciated.

Download

The ZIP-archive contains a demo-page. By downloading it you agree to the terms of the GNU Public License.

Downloads:
FileLast Modified
Download this file (lake.20081207.zip) lake.20081207.zip2008-12-07
Last Updated on Saturday, 14 February 2009 09:56
 
Comments (5)
@Brian
5 Sunday, 02 November 2008 14:57
A. Berger
Hi Brian!

To have the script working properly with a DTD-declaration you will have to wait a week or so - its in the pipeline :)

Meanwhile I sent you a mail with a quick and dirty rewritten file.

Greets
Andreas
Lake: DOCTYPE
4 Sunday, 02 November 2008 14:38
Brian Watson
Oops, sorry: with that DOCTYPE, the ripple effect works, but my page fails to validate because the DOCTYPE doesn't support loads of the code on my page (http://www.brianwatsonphoto.co.uk/Pictorial/pages/page_19.html).

Is there a DOCTYPE which will both validate correctly, and allow the "Lake" effect to be used at the same time?

Regards,

Brian

www.brianwatsonphoto.co.uk
@Brian
3 Sunday, 02 November 2008 13:28
A. Berger
Hi Brian!

The scripts are originally all scripted in Quirks-Mode. The panoramascript is allready rewritten, the slideshow I updated yesterday. They both work fine with X-HTML 1.1 Transitional.

At the moment I am working on a new Joomla-Plugin but the other javascripts will get updated soon (at least one of them next week).

greets
Andreas

PS.: If you do not want to wait, the problem usually is an omitted "px" when setting width, height, or position. This is no problem in Quirksmode but produces an error when using a DTD-declaration. :)

PPS.: Thanks a lot for your testing on OS-X!
Lake and DOCTYPEs
2 Sunday, 02 November 2008 12:44
Brian Watson
My page using "Lake" wouldn't validate without a DOCTYPE. I tried several (I don't understand them) but all except one stopped the effect from working.

This one works:
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"

Hope this helps (it took a long time to find what the problem was!).

Best wishes,

Brian

www.brianwatsonphoto.co.uk
Lake
1 Sunday, 02 November 2008 00:38
Brian Watson
Works great with Mac OS X 10.5.5 with all of these:
- Safari 3.1.2
- Firefox 3.0.3
- Opera 9.52
Thanks (with a link from my site to yours),
Brian

www.brianwatsonphoto.co.uk
English
Panoramic Image Viewer
AddThis Social Bookmark Button
Who's Online
We have 31 guests online
Latest Items