Tooltip Example 10.6 |
Tooltip Example 10.6 |
Jan 8 2009, 12:01 PM
Post
#1
|
|
|
|
Prototype JavaScript framework, version 1.6.0.3
Tooltip example 10-6 I have been struggling with this example. I have not yet implemented the Ajax functionality, though the tooltip does not seem to position in FF and Safari. Making an adjustment in the function positionToolTip by adding the pixel unit does the trick. return({ top: tipTop+"px", left: tipLeft+"px", }); I know it is minor, but imperative for this code to work cross-browser. And while I am at it to complete the code, the tooltip functionality should be evoked while loading the document. It is mentioned in the comments of the code, but hey .. why not paste the code here. Place this at the beginning. if(window.addEventListener) window.addEventListener('load', loadToolTips, false); else attachEvent('onload', loadToolTips); |
|
|
|
![]() |
Jan 9 2009, 07:44 AM
Post
#2
|
|
|
Active Member ![]() ![]() Group: O'Reilly Author Posts: 14 Joined: 17-September 08 From: Shiloh, IL Member No.: 911 |
You are absolutely right about the positionToolTip function needing the px. My fault that I missed that, and I will make sure that gets in the errata.
Since the example is already using Prototype, let's change that event listener to: CODE Event.observe(window, 'load', loadToolTips, false); Thanks for the catch of this error! |
|
|
|
Jan 13 2009, 04:13 PM
Post
#3
|
|
|
|
I have another thing with this code. I am trying to catch the scroll value. No matter what I keep getting the value "0" as in zero.
Looking around on the internet I get a referal to using documentElement as in: valueScrollTop = document.documentElement.scrollTop; This statement gives me a perfect value. The original "document.body.scrollTop" comes up with a constant zero. The issue seems to evolve around the usage of a DOCTYPE. I don't know if it is stanrdard issue to leave out the DOCTYPE with Ajax, but I doubt that. What is going on here? |
|
|
|
Jan 16 2009, 12:40 PM
Post
#4
|
|
|
|
I must start with apologizing for the post above. It goes beyond the scope of the book and is more an issue for a book on "Browser Hell"
I did make an adjustment to the mouseMovement function making use of prototype's pointX and pointY, which is also available in version 1.5.1.1. It simplifies this function. CODE function mouseMovement(e) { mousePosition = { x: e.pointerX(e), y: e.pointerY(e) }; } On with the work .. |
|
|
|
Aug 21 2009, 07:12 AM
Post
#5
|
|
|
|
Have anyone has read the book so called BROWSER HELL??
-------------------- Does Someone Do Medical Assistant Jobs like me? then please guide me to start a Medical Assistant Career.
|
|
|
|
Aug 26 2009, 01:04 AM
Post
#6
|
|
|
|
I did make an adjustment to the mouseMovement function making use proprietaire simulation rachat credit immobilier consommation - demander un rachat de crédit, faites une simulation rachat de credit en ligne.proprietaire simulation rachat credit immobilier consommation
|
|
|
|
Sep 3 2009, 01:08 AM
Post
#7
|
|
|
|
I was confused. Thanks for you information
free tattoo removal cream before and after lazer prices this is the blog for tattoo removal cream prices and cost. the best cream to pruchase free tattoo removal cream before and after lazer prices |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd November 2009 - 05:04 PM |