You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

this[0].ownerDocument Created Nov 18, 2009

This thread is solved

Views: 2652     Replies: 5     Last reply Dec 27, 2011  
You must login first before you can use this feature

lethux

Posts: 7

Registered:
Jun 12, 2009

this[0].ownerDocument

Posted: Nov 18, 2009

Hi,
I need to show the tooltip to let user pick up the right choice after he fills an input text. When the user focus on that field the very first time, tooltip does not exist yet. It will be shown after he blurs away, the value is picked up by a func that does some ops, fill the 'tooltip2show' div with these results and than shows the tootip.
This is html and js codes:


<input id="myfield" name="blabla" onblur="myfunc()">
<div id="tooltip2show"></div>


var tp=null;
function myfunc(){
//do something to pick some options based on user text and put into div
$('#tooltip2show').html('some options for the user: a) <span onlick="closeMe()">opt1</span> <br> b) <span onlick="closeMe()">opt2</span> ');
tp = $('#myfield').tooltip();
tp.show();
//this prevents from showing the tooltip while the user is re-editing the field
$("#myfield").unbind("focus"); 
$("#myfield").unbind("mouseover");
}
function closeMe(){
tp.hide();
}

It works fine for the first time the tooltip is shown. If the users edit the input field again, change that value, blur from the field, I have this error message and the tooltip wont show again:

Error: this[0].ownerDocument is undefined
Source:http://cdn.jquerytools.org/1.1.2/jquery.tools.min.js
Row: 31

These is getting me crazy from the whole day and can't find a way. I've tried putting the inizialization on other lines, tried onBeforeShown and onShow call backs to get the moment where the tooltip will show or hide, but I can't figure out how to fix and have the tooltip show again after the first time.
Regards and thanks in advance for any advice.
Robert.

droughnot

Posts: 1

Registered:
Dec 31, 2009

» this[0].ownerDocument

Posted: Dec 31, 2009

Reply to: this[0].ownerDocument, from lethux
I get the same error:



$(document).ready($(function(){

    $("#clinrawtable img").tooltip({ 
    // each trashcan image works as a trigger 
    tip: '#tooltip1', 
    // custom positioning 
    position: 'center right', 
    // move tooltip a little bit to the right 
    offset: [4, 4], 
    // do not initialize tooltips until they are used 
    lazy: true, 
    // there is no delay when the mouse is moved away from the trigger 
    delay: 1 
    });
  
    $("#clinrawtable img").tooltip({ 
    // each trashcan image works as a trigger 
    tip: '#tooltip2', 
    // custom positioning 
    position: 'center right', 
    // move tooltip a little bit to the right 
    offset: [4, 4], 
    // do not initialize tooltips until they are used 
    lazy: true, 
    // there is no delay when the mouse is moved away from the trigger 
    delay: 1 
    });

  }));


Maybe I have error but I don't see it.