PDA

View Full Version : Firefox 1.0.6 is having problem with Link Floatie script



KCgame
09-12-2005, 02:24 PM
Hi all,

I used FF 1.0.6 and integrate the Link Floatie script

http://www.dynamicdrive.com/dynamicindex5/linkfloaties.htm

into my script.

I tried on IE and it works great, however, FF cannot display the last line properly :(
The last line of the text falls just below the box outside..and block by the toolbar below..

Can anyone help me with this?
Any help / comment will be appreciated.
Thank you.

jscheuer1
09-12-2005, 06:26 PM
Well, the demo page of this script works fine in both of the browsers that you mention, here. Perhaps you need to set the the optional width/height as explained on the demo page:

showfloatie('link_text', event, 'optional_bgcolor', optional_width, optional_height)

As mentioned, the last 3 parameters are all optional. Here are a few sample callings:

1) showfloatie('<p>Some text</p>', event, 'lightblue')

2) showfloatie(floattext[0], event, '', 300, 200)

3) showfloatie('<b>I\'m the king of the world!</b>', event)See demo page for more details. If that doesn't get it for you then:

.

KCgame
09-13-2005, 12:55 AM
Thanks jscheuer1,

I increase the width and height of the box and it works^^

KCgame
09-13-2005, 06:05 AM
..hmm sorry to post again..but i would like to shift the box to top right hand corner :rolleyes:

May i know how to change the code to make it appear at the top right?


function showfloatie(thetext, e, optbgColor, optWidth, optHeight){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
var floatobj=document.getElementById("dhtmlfloatie")
floatobj.style.left="-900px"
floatobj.style.display="block"
floatobj.style.backgroundColor=paramexists(optbgColor)? optbgColor : floatiebgcolor
floatobj.style.width=paramexists(optWidth)? optWidth+"px" : floatiewidth
floatobj.style.height=paramexists(optHeight)? optHeight+"px" : floatieheight!=""? floatieheight : ""
floatobj.innerHTML=thetext
var floatWidth=floatobj.offsetWidth>0? floatobj.offsetWidth : floatobj.style.width
var floatHeight=floatobj.offsetHeight>0? floatobj.offsetHeight : floatobj.style.width
var winWidth=document.all&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winHeight=document.all&&!window.opera? ietruebody().clientHeight : window.innerHeight
e=window.event? window.event : e
floatobj.style.left=dsocx+winWidth-floatWidth-5+"px"
if (e.clientX>winWidth-floatWidth && e.clientY+20>winHeight-floatHeight)
floatobj.style.top=dsocy+5+"px"
else
floatobj.style.top=dsocy+winHeight-floatHeight-5+"px"
slowhigh(floatobj)
}

I believe the above function is the place to amend but i just can't get it working..
Any help / comment will be greatly appreciated.
Thank you.

jscheuer1
09-13-2005, 09:09 PM
You're right, specifically, these lines position the floatie:


floatobj.style.left=dsocx+winWidth-floatWidth-5+"px"
if (e.clientX>winWidth-floatWidth && e.clientY+20>winHeight-floatHeight)
floatobj.style.top=dsocy+5+"px"
else
floatobj.style.top=dsocy+winHeight-floatHeight-5+"px"They do so by attempting to calculate a spot on the page, near the trigger element, that will allow the entire floatie to be visible on the screen. In most cases, this works. However, if you have a spot already in mind for the floatie (as it appears you do) you can replace these lines, like so, to tell the script exactly where you want it to appear:

floatobj.style.left="20px"
floatobj.style.top="20px"The left one is how far from the left it will appear, the top, how far from the top. All floaties will now appear in this position.