Please Log-in or Register to get full access to the forums.


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'style is undefined' error
10th July, 18:04
Post: #1
'style is undefined' error
I'm trying to integrate qTip into a rails application.

However, when I load the qTip script, I get a 'style is undefined' error with reference to the sanitzeStyle() method:

JS Code
// Sanitize styles
   function sanitizeStyle(style)
   {
      if(typeof style.tip !== 'object') style.tip = { corner: style.tip }; 
      // 'style is undefined'!
 
      if(typeof style.tip.size !== 'object') style.tip.size = { width: style.tip.size, height: style.tip.size };
      if(typeof style.border !== 'object') style.border = { width: style.border };
      if(typeof style.width !== 'object') style.width = { value: style.width };
      if(typeof style.width.max == 'string') style.width.max = parseInt(style.width.max.replace(/([0-9]+)/i, "$1"));
      if(typeof style.width.min == 'string') style.width.min = parseInt(style.width.min.replace(/([0-9]+)/i, "$1"));
 
      // Convert deprecated x and y tip values to width/height
      if(typeof style.tip.size.x == 'number')
      {
         style.tip.size.width = style.tip.size.x;
         delete style.tip.size.x;
      };
      if(typeof style.tip.size.y == 'number')
      {
         style.tip.size.height = style.tip.size.y;
         delete style.tip.size.y;
      };
 
      return style;
   };


Which strikes me as a very strange error, as style is certainly defined -- it's the only parameter!

This is even more bewildering as I'm sure I've had qTip working well before in a similar app.

Thanks in advance, if anything jumps out at you...
Find all posts by this user
Quote this message in a reply
10th July, 18:06
Post: #2
'style is undefined' error
OK, well, turns out it's actually working -- drawing the tips, etc.

The error message is still a bit worrisome, however.
Find all posts by this user
Quote this message in a reply
11th July, 13:47
Post: #3
'style is undefined' error
Joe W,

Could you provide the rest of your code so I can see where this error might be occurring please? Looks like its something to do with the buildStyle code.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  'undefined' is not an object (evaluating 'c.msie') bedos 1 1,224 23rd September 13:33
Last Post: Craig
  IE7 error - works only from the second click on item in the tooltip yoram 0 853 25th July 09:34
Last Post: yoram
  [Solved] Uncaught TypeError: Cannot read property 'mozilla' of undefined sdeeds 1 1,374 23rd June 13:00
Last Post: Craig
  qTip positions error xujunbocat 0 882 Today 03:28
Last Post: xujunbocat
  [Solved] IE 8 "Style > Tip" not displaying shameless hacker 30 20,082 9th February 18:49
Last Post: nickast
  [Solved] error when subscribing mplungjan 1 1,189 27th September 15:18
Last Post: Craig
  qtip thows script error 'parent is null' prasanthreddyp 1 1,527 12th September 17:16
Last Post: Craig
  [Solved] error: missing}after property list captamirul@yahoo.com 8 4,458 10th September 15:22
Last Post: Craig
  How to style/theme tooltip? petiar 3 2,133 26th June 12:37
Last Post: Craig
  [Solved] Wierd error: "v is undefined" aquinn 6 5,446 3rd June 09:01
Last Post: Craig



User(s) browsing this thread: 1 Guest(s)