Results 1 to 4 of 4

Thread: Javascript Tooltip OnClick Help please

  1. #1
    Join Date
    Aug 2007
    Location
    usa
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Javascript Tooltip OnClick Help please

    1) Script Title: Rich-HTML Balloon Tooltip

    2) Script URL (on DD):

    http://www.dynamicdrive.com/dynamici...oontooltip.htm

    3) Describe problem:
    I was wondering if anyone could tell me how to change the Javascript to activate the tooltip On Click instead of on mouse over?

    It would be so extremely helpful!

    Or if there is a different script that would be better for this?
    I wanted something like this:
    http://cab.rit.edu/?s=calendar (click a calendar link)

    I can't find anything closer than this Rich-HTML Baloon on DD.

    Thank you for any help you can provide!

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Find this function:
    Code:
    function initalizetooltip(){
    var all_links=document.getElementsByTagName("a")
    if (enablearrowhead){
    tiparrow=document.createElement("img")
    tiparrow.setAttribute("src", arrowheadimg[0])
    tiparrow.setAttribute("id", "arrowhead")
    document.body.appendChild(tiparrow)
    }
    for (var i=0; i<all_links.length; i++){
    if (reltoelement(all_links[i])){ //if link has "rel" defined and it's the ID of an element on page
    all_links[i].onmouseover=function(e){
    var evtobj=window.event? window.event : e
    displayballoontip(this, evtobj)
    }
    all_links[i].onmouseout=delayhidemenu
    }
    }
    }
    And instead, use:
    Code:
    function initalizetooltip() {
      var all_links = document.getElementsByTagName("a");
      if (enablearrowhead) {
        tiparrow = document.createElement("img");
        tiparrow.src = arrowheadimg[0];
        tiparrow.id = "arrowhead";
        document.body.appendChild(tiparrow);
      }
      var onf = function(e) {
        displayballoontip(this, e || event);
        document.onclick = delayhidemenu;
      };
      for (var i=0; i<all_links.length; i++)
        if (reltoelement(all_links[i])) //if link has "rel" defined and it's the ID of an element on page
          all_links[i].onclick = onf;
    }
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2007
    Location
    usa
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I Love You!! :d

  4. #4
    Join Date
    Aug 2007
    Location
    usa
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oops, sorry, It actually isn't working for me. Did I do it wrong?
    I replaced the function you specified above.

    ... but the Tooltips aren't showing up at all now.

    Link:
    http://www.d.umn.edu/~kirbypb/test1.html


    And I don't want the actual links to go anywhere but return false doesn't seem to be working either.. ?

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
  •