Results 1 to 3 of 3

Thread: DHTML Window II and DHTML Tooltop II conflict

  1. #1
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DHTML Window II and DHTML Tooltop II conflict

    I am using:

    - http://www.dynamicdrive.com/dynamici...ndow/index.htm
    &
    - http://www.dynamicdrive.com/dynamici...mltooltip2.htm

    They work great; however, they dont work together very well. Any time you interact with the handle of the DHTML window the tooltip no longer works. You have to refresh the page to get the tooltops back.

    Is there anyway to fix this issue?

    Thanks.

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,821
    Thanks
    2
    Thanked 425 Times in 419 Posts

    Default

    for the tool tip (change in red)

    Code:
    /***********************************************
    * Cool DHTML tooltip script II-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    var offsetfromcursorX=12 //Customize x offset of tooltip
    var offsetfromcursorY=10 //Customize y offset of tooltip
    
    var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
    var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).
    
    document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
    document.write('<img id="dhtmlpointer" src="arrow2.gif">') //write out pointer image
    
    var ie=document.all
    var ns6=document.getElementById && !document.all
    var enabletip=false
    if (ie||ns6)
    var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
    
    var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""
    
    function ietruebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    }
    
    function ddrivetip(thetext, thewidth, thecolor){
    if (ns6||ie){
    if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
    if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
    tipobj.innerHTML=thetext
    enabletip=true
    return false
    }
    }
    
    function positiontip(e){
    if (enabletip){
    var nondefaultpos=false
    var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
    var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
    //Find out how close the mouse is to the corner of the window
    var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
    var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
    
    var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
    var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY
    
    var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000
    
    //if the horizontal distance isn't enough to accomodate the width of the context menu
    if (rightedge<tipobj.offsetWidth){
    //move the horizontal position of the menu to the left by it's width
    tipobj.style.left=curX-tipobj.offsetWidth+"px"
    nondefaultpos=true
    }
    else if (curX<leftedge)
    tipobj.style.left="5px"
    else{
    //position the horizontal position of the menu where the mouse is positioned
    tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
    pointerobj.style.left=curX+offsetfromcursorX+"px"
    }
    
    //same concept with the vertical position
    if (bottomedge<tipobj.offsetHeight){
    tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
    nondefaultpos=true
    }
    else{
    tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
    pointerobj.style.top=curY+offsetfromcursorY+"px"
    }
    tipobj.style.visibility="visible"
    if (!nondefaultpos)
    pointerobj.style.visibility="visible"
    else
    pointerobj.style.visibility="hidden"
    }
    }
    
    function hideddrivetip(){
    if (ns6||ie){
    enabletip=false
    tipobj.style.visibility="hidden"
    pointerobj.style.visibility="hidden"
    tipobj.style.left="-1000px"
    tipobj.style.backgroundColor=''
    tipobj.style.width=''
    }
    }
    
    //document.onmousemove=positiontip
    
    document.addEventListener?document.addEventListener('mousemove',function(e){ return positiontip(e);},false):document.attachEvent?document.attachEvent('onmousemove',function(e){ return positiontip(e); }):null;
    
    I have also upsated the Window script to make it less intrusive

    http://www.vicsjavascripts.org/Demos/140718A.htm
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That worked great! Thanks.

    What has been updated about the window script?

Similar Threads

  1. how to open new DHTML Window from DHTML Window
    By todort in forum Dynamic Drive scripts help
    Replies: 12
    Last Post: 11-09-2010, 03:52 AM
  2. Cool DHTML Tooltip & DHTML Window Widget
    By dhepburn in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 05-31-2009, 10:46 PM
  3. DHTML ToolTip whithin DHTML Window
    By hrfassoc in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 01-28-2008, 06:04 AM
  4. Close event DHTML window interferes with DHTML tooltip II?
    By Emile in forum Dynamic Drive scripts help
    Replies: 10
    Last Post: 06-21-2007, 07:47 PM
  5. Replies: 8
    Last Post: 03-26-2007, 10:19 AM

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
  •