2013-11-04 47 views
0

我正在使用qtip1.0。我需要在函數調用中顯示qtip。Qtip內容prerender給出JavaScript運行時錯誤:

如果我使用content prerender:true,它會給出下面提到的錯誤。

JavaScript runtime error: Unable to get property 'nodeName' of undefined or null reference

我已將此添加到我的母版頁中。

<script src="Scripts/jquery.qtip-1.0.0-rc3.min.js" type="text/javascript"></script> 

我在MY頁面文檔就緒函數中有以下代碼。

$('#printDiv').qtip(
     { 

      show: { 
       event: 'click', // Show it on click 
       solo: true // And hide all other tooltips 
      }, 

      content: { 
       prerender: true, 
       title: { 
        text: 'Core Details', 
        button: 'Close' 
       }, 
       text: 'Show the content' 

      }, 

      position: { 
       target: $(this).closest($(document.body)), // Position it via the document body... 
       corner: 'center' // ...at the center of the viewport 
      }, 

      style: { 
       width: { max: 650 }, 
       padding: '14px', 
       border: { 
        width: 9, 
        radius: 9, 
        color: '#666666' 
       }, 
       name: 'light' 
      }, 
      api: { 
       beforeShow: function() { 
        // Fade in the modal "blanket" using the defined show speed 
        $('#qtip-blanket').fadeIn(this.options.show.effect.length); 
       }, 
       beforeHide: function() { 
        // Fade out the modal "blanket" using the defined hide speed 
        $('#qtip-blanket').fadeOut(this.options.hide.effect.length); 
       } 
      } 
     }); 



     // Create the modal backdrop on document load so all modal tooltips can use it 
     $('<div id="qtip-blanket">') 
      .css({ 
       position: 'absolute', 
       top: $(document).scrollTop(), // Use document scrollTop so it's on-screen even if the window is scrolled 
       left: 0, 
       height: $(document).height(), // Span the full document height... 
       width: '100%', // ...and full width 

       opacity: 0.7, // Make it slightly transparent 
       backgroundColor: 'black', 
       zIndex: 5000 // Make sure the zIndex is below 6000 to keep it below tooltips! 
      }) 
      .appendTo(document.body) // Append to the document body 
      .hide(); // Hide it initially 
+0

你會很好地發佈一些HTML。 – shanabus

+1

如果您只使用版本1,請不要使用[tag:qtip2]標記您的問題......這帶來了另一個好處... qTip v1在兩年前qTip 2出現時已過時。現在是升級的時候了。 – Sparky

回答

0

你從來沒有說過你試圖使用qTip 1.0的jQuery版本。然而,考慮到兩年前qTip 1.0已經被qTip2廢棄了,可以肯定地說qTip 1.0與你使用的任何版本的jQuery不兼容......除非它真的很老。

Upgrade to qTip2(推薦)或downgrade jQuery to whatever version上次使用qTip 1.0兼容(不推薦)。