PDA

View Full Version : Will Pay For Custom Configuration Of Script. Please Look!



ideffect
01-03-2005, 08:22 PM
Hi,

I posted a message last week but have not gotten a responce. I'm trying to use a floating script inside a table but part of the buttons are cut off depending on screen resolution. I would like the button to lay on the middle of the screen after scrolling down the page a little. I don't know how much work this would be to accomplish so I don't know how much to offer. If you think you can do it, let me know how much you want to do it. You can either reply in this message or by PM. If you need more instructions on what I'm trying to accomplish, let me know.

Here is the original post with some more info...

Hello,

I have a site http://www.thevortexbusinessinabox....ent/view/13/40/ that i've been working on. I'm trying to get the floating menu to sit in the center of the page after it moves from the top. The floating menu sits in a frame that starts about 170px from the top. When looking from the very top, the bottom part of the menu is not visible. When scrolling down the page, that section of the menu is never visible. I'm hoping there's a way to adjust for that. I've tried a few diffrent ideas with no luck. The script's location is http://www.dynamicdrive.com/dynamic.../staticmenu.htm

I had to modify the script to work as it does now. I'm going to put the file below.

In the HTML

Code:


<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:relative">')
</script>
<layer id="divStayTopLeft">
<?php mosLoadModules ( 'left' );?> <--Mambo Coding
</layer>

The script

Code:


//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"

if (!document.layers)
document.write('</div>')

function JSFX_FloatTopDiv()
{
var startX = 0,
startY = 0;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/70;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/30;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 20);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();


I really like this script but if you know of one that's better suited for what I am trying to do, please let me know.
Thank you for your help!

Minos
01-03-2005, 09:24 PM
Your links do not work. Also, where are trying to put this? Actual smack-dab center of screen, or the middle on the left, etc? I am trying to imagine what you're attempting..to no avail. Maybe I'm just dumb this morning :(

ideffect
01-03-2005, 09:44 PM
Hi,

Sorry about the links not working. I copied the old post and the links didn't copy right.

Try this link: http://www.thevortexbusinessinabox.com/content/view/34/72/
I'm working on the buttons right now so some of them won't look right.

What i'm looking for is once the page is scrolled down, the buttons stay in the center of the screen with equal distance from the top and the bottom of the page. It's also going to have to stay in it's current table. Once you see, it will make more sense.

]

Minos
01-03-2005, 09:53 PM
mmhmm...Damn those people with ****ty resolutions :P. I'll see what I can do, aside from forcing their resolution to the right size :D.

cr3ative
01-04-2005, 09:41 AM
ideffect- I know exactly what you mean now, and I'll try to figure out a solution.

I don't accept payment for any work I do though... I just don't see it as right to do so. :)

Regards
cr3ative

cr3ative
01-04-2005, 09:53 AM
ideffect - Sorry, but before we can help, you must put our copyright notice back onto the script. For terms of usage, please visit www.dynamicdrive.com/notice.htm

Please reply to this thread when this is done, and we can continue to work on the script :)

cr3ative

ddadmin
01-04-2005, 12:48 PM
As cr3ative, please respect our copyright by following our TOS first.

Thanks,

ideffect
01-04-2005, 06:03 PM
Hello,

I kept the copyright notice intact but made the file external. I was not aware that if a file was made external, the copyright needed to be inserted on the page elsewhere.

Anyway, I think i've think I did it right. You could tell me better...

cr3ative
That's real nice of you to take this task on without payment...
Thank you!

And thank you Dynamic Drive for the great resouce that it is!

ideffect
01-05-2005, 05:15 PM
Anyone has any ideas?

cr3ative
01-05-2005, 09:16 PM
I've got it working to an extent.

But at the moment, It crashes MSIE 90% of the time, so I have some bugs to iron out.

cr3ative

ideffect
01-08-2005, 06:20 PM
Hey cr3ative,

I just wanted to see how it was goin'. Any luck yet?

cr3ative
01-08-2005, 07:17 PM
'Fraid not.

All I can do is make it drop more pixels than usual after it is shifted from its starting place. Let me explain.

Once it shifts over 400 px from top (it's resting place), it then adds another 150px, which centers it slightly better, but it isn't reading the screen height or browser height.

It's vaguely better, so here it is, the new menu.js:


/*
Floating Menu script- Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
Modified for idEffect by Cr3ative
*/

//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"

if (!document.layers)
document.write('</div>')

function JSFX_FloatTopDiv()
{
var startX = 0,
startY = 0;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (ftlObj.y>=400) {
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y - 100)/30;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/20;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
};
if (ftlObj.y<=400) {
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y )/30;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/20;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);

};
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();

cr3ative

ideffect
01-15-2005, 05:40 PM
Hey cr3ative,

Thanks for trying! Sorry it took me soo long to reply. I do have another question however. Is it possible to have 2 copies of the script on the same page? The diffrences in the script would be the speed settings.

Thanks again! I really appriciate your help...