This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
Floating layers

How do I modify the bravenet floating layer script (found in scripts archive uunder scrollers) to stay at the far left of the page, as oposed to in the middle?

Also how do you enter script into this forum and keep it as script?

Re: Floating layers

The function layerSetup() controlls the horizontal positioning of the floating object. The line that says:

floatLyr = new layerObject('floatLayer', pageWidth * .5);

is taking the current page width and dividing it by two, to find the screen center. You can change the multiplication factor to move it any where you want, horizontally. For example, the following change would move the object to the center of the left half.

floatLyr = new layerObject('floatLayer', pageWidth * .25);

To move it further to the left, just reduce the multiplication factor, like this:

floatLyr = new layerObject('floatLayer', pageWidth * .1);

It would be a good idea to set the multiplication factor to zero, or remove it completely. Just make it small enough to account for a little bit of a margin on the left.

You can also control how far down the screen the object travels by adjusting the topMargin variable. A larger number will put it further down the screen.

var topMargin = 100;

The variable slideTime controlls how fast the object slides down the screen. Lower numbers will make the object scroll down faster.

var slideTime = 1200;

Most Javascript can be just posted, however, you sometimes have to make adjustments to the code, to disable some functions and make them display. The forum has a tendency to just throw away anything that might be detrimental to the forum, so always make sure you preview your posting, to make sure it is displaying everything you want it to.

When you post HTML code, you need to replace all occurences of the left bracket, <, with it's entity equivalent, < or <. This will effectively disable to code and allow it to display. Some people replace the right bracket, >, as well with > or >, but I don't usually bother.

Posting gets a little tricky sometimes, and can really mess up the forum posting. It easier to just give us a URL of your site, or a test page, where the code exists. We can view the code ourselves.

Re:Floating layers

Thanks for that. Is there any way to make the pane appear in the center of the height, I tried:
topmargin = pageHeight * .5
but it didn't like it.