Results 1 to 5 of 5

Thread: Firefox 1.0.6 is having problem with Link Floatie script

  1. #1
    Join Date
    Sep 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Firefox 1.0.6 is having problem with Link Floatie script

    Hi all,

    I used FF 1.0.6 and integrate the Link Floatie script

    http://www.dynamicdrive.com/dynamici...nkfloaties.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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks jscheuer1,

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

  4. #4
    Join Date
    Sep 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ..hmm sorry to post again..but i would like to shift the box to top right hand corner

    May i know how to change the code to make it appear at the top right?
    Code:
    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.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You're right, specifically, these lines position the floatie:
    Code:
    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:
    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •