I'm just guessing here, but according to the docs, any event added
with addEvent() automatically gets the extend event object, but since
you're not doing that, it isn't. You'll have to do this: new Event(e);
to extend the event object so it'll have a page property.
On Oct 13, 7:13 pm, DustyReagan <[EMAIL PROTECTED]> wrote:
> Thanks again for your help Chris.
>
> I tried passing the event object created from onmouseover, but I still
> get that 'event.page' is undefined error. The interesting thing is
> that the event object itself is populated. I can see the values while
> debugging the script. It just doesn't have event.page attribute on it.
> I'm guessing event.page is on mouseenter, not mouseover. But how do I
> dynamically create a new mouseenter event?
>
> My code is looking something like the following now. (which works, but
> with errors.)
>
> function tipit(image, e)
> {
> ....
> element.fireEvent('mouseenter', e);
> ...
>
> }
>
> <img onmouseover="tipit(this, event)" ... />
>
> Dusty
>
> On Oct 13, 3:05 pm, Chris J <[EMAIL PROTECTED]> wrote:
>
> > Hmm, that's because when firing an event, an event object isn't passed
> > to the function. That's why event.page isn't defined. If you're
> > attaching the tooltips on mouseover, then you should just be able to
> > pass the event object created from that to mouseenter, instead of
> > element.
>
> > Not sure if this would work either, but you could try attaching a tip
> > on mouseenter and you wouldn't have to fire it manually.
>
> > On Oct 13, 12:19 pm, DustyReagan <[EMAIL PROTECTED]> wrote:
>
> > > You're my hero Chris. That did it!
>
> > > However, it's causing 'event.page' to be undefined, and an error is
> > > thrown in the position: function(event) method of Tips. I'm working on
> > > debugging that now, but if you have any ideas on how to get rid of
> > > that error, I'm all ears! :)
>
> > > Dusty
>
> > > On Oct 13, 8:46 am, Chris J <[EMAIL PROTECTED]> wrote:
>
> > > > Haven't tried it, but try firing mouseenter instead of elementEnter.
>
> > > > On Oct 12, 7:37 pm, DustyReagan <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi,
>
> > > > > I need help manually calling the elementEnter function on an
> > > > > element... I think.
>
> > > > > I'm using the Tool Tips plugin on my project. The problem I'm having
> > > > > is that all the demo code I've seen for the Tips plugin works by
> > > > > attaching a new Tip for every occurrence of your specified class as
> > > > > soon as the DOM finishes loading. Like this:
>
> > > > > var Tips1 = new Tips($$('.Tips1'));
>
> > > > > My problem is I sometimes have many thousands of objects, and that
> > > > > JavaScript is killing my browser.
>
> > > > > I'd like to attach the element to the Tips object as soon as someone
> > > > > mouses over an object, instead of trying to load every instance all at
> > > > > once. I've nearly got this figured out below, but the problem is after
> > > > > I do the attach, the mouse is already moused over the element (an
> > > > > image in my case), so the Tip doesn't show until you move your mouse
> > > > > off the element, then move it back over.
>
> > > > > I think I can fix this by somehow manually calling elementEnter on my
> > > > > image so that it causes the Tips to fire right after I've attached it.
> > > > > I'm not sure how to call elementEnter manually.
>
> > > > > Any ideas?
>
> > > > > My code thus far:
>
> > > > > <script type="text/javascript">
>
> > > > > window.addEvent('domready', function(){
> > > > > tipz = new Tips();
>
> > > > > });
>
> > > > > function tipit(image)
> > > > > {
> > > > > element = $(image);
> > > > > if(element.get("title") != null)
> > > > > {
> > > > > var content = element.get("title").split('::');
> > > > > element.store('tip:title', content[0]);
> > > > > var tipString = '';
>
> > > > > if(content[0] != content[1])
> > > > > tipString += '<strong>Name: </strong>' +
> > > > > content[1] + '<br />';
> > > > > if(content[2] != '')
> > > > > tipString += '<strong>Location: </strong>' +
> > > > > content[2] + '<br />';
> > > > > tipString += '<strong>Followers: </strong>' +
> > > > > content[3];
>
> > > > > element.store('tip:text', tipString);
>
> > > > > tipz.attach(element);
>
> > > > > element.fireEvent('elementEnter', element); // This
> > > > > doesn't work. :(
> > > > > }}
>
> > > > > </script>
>
> > > > > Thanks!
>
> > > > > Dusty