View Full Version : Event object?
ScottInTexas
12-09-2002, 12:36 AM
Looking through examples of tool tip scripts I found an onMouseOver that calls a function and passes (this, event, "Tool tip text").
Can a table data cell (<TD>)have an id? Can it pass the this and event objects? I tried it but I just may have the syntax wrong. I am trying to attach a tool tip to a calendar date. If the calendar date is a marked day then I want the mouseover to cause a pop up to tell what the day is about.
The tool tips etc. I have found are all close but seem to miss what I want to do. They all rely on the mouse to be over an <a> tag.
Any ideas?
beetle
12-09-2002, 12:58 AM
Yes a table cell can have an ID
Yes, any event attached to a table cell can pass those object references.
Can I see your code, maybe there is a syntax error.
ScottInTexas
12-09-2002, 01:08 AM
Beetle
Here is the code. I've kept it short so if you need more then let me know.
bigTxt+="<TD class='anAppt' id='" + ((n+1)+(i+1)) + "') onMouseOver='parent.showappt(this,event)'>" + (dayLoop) + "</TD>"
function showappt(which,e){
alert("In appointment");
appt.document.write("In appt <br>");
appt.document.write("X axis=" + e.PageX);
}
Yhanks for such a quick response with the first question. I really appreciate it.
beetle
12-09-2002, 01:10 AM
Ok, what is appt?
ScottInTexas
12-09-2002, 02:02 AM
appt is the name of the iframe I want to write the text to. Or should I use div?
beetle
12-09-2002, 02:34 AM
Ok so you are
1) Writing HTML-text to the IFRAME's document
2) calling a function in the parent from the onmouseover event
Do I got that right?
Do you have a link to this page?
ScottInTexas
12-09-2002, 03:00 AM
No, I don't have a link I don't even have domain to place the page yet. This is for the 4-H club and we're still getting it together.
I zipped a text file of it and put it here. At least I did the attachment. It is only a little over 4K.
I really appreciate you looking at this.
EDIT!!
I blew off the zip. I just attached the file, however I don't see the attachment. I don't know how to drive this right yet.
Yes you are right in your post. The idea is that a day is marked (I'm just giving it a red background right now). The user moves the mouse over a marked day and the tool tip appears to display what the date is about. The function showappt() will get the text from the nth element of the appt array. I should be passing the array element. I'll just pass the month and day parameters.
If you don't see the attachment I'll email it directly to you or I'll just post it between the [CODE] tags. You choose.
Or just tell me to look it up. I was just looking at your site xs4all.net. I'll be spending some time there. Thanks again.
whammy
12-09-2002, 03:03 AM
I think you forgot to attach the file. :)
ScottInTexas
12-09-2002, 03:18 AM
What is the deal? I saw the attachemnt in the text box but I don't know where it went!
Attempt 2.
jonathan
12-09-2002, 09:48 PM
Hey I looked at that samply you posted and found it in the txt file you sent but I was wondering about where you wrote
<TD class='anAppt' id='" + ((n+1)+(i+1)) + "') which would put a ")" after the closeing " in the td id. Wouldn't you want it without it like this
<TD class='anAppt' id='" + ((n+1)+(i+1)) + "'
I really didn't look at the rest but that just stuck out at me.
ScottInTexas
12-10-2002, 01:21 AM
You're right, just a typo. Don't know when I put it there. Thanks. My whole problem with this working is that I can't properly address every object on my web page. I read stuff on the web and I get an 'almost' answer.
I tried this with a div but pageX and pageY members weren't known. It might be a cause of the way I try adressing the div or it might be an IE problem.
Oh well, there is a person out here who has done what I am trying to do or has the knowledge to do it. Hope he/she answers soon.
Thanks everyone.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.