2010-10-06 74 views
1

http://rndnext.blogspot.com/2009/02/jquery-ajax-tooltip.html需要幫助jQuery工具提示

我想實現類似上面的鏈接。現在,這會彈出框的從某個頁面獲取數據,使用PageID以及不是。我希望該彈出框的內容具有簡單的HTML內容,並且稍後會被綁定。上面的那個獲得了我不熟悉的Ajax。

我需要在代碼中更改什麼?我想要的只是一個簡單的彈出框,看上去與上面的框完全相同,打開的方式和所有方式相同,但是它有簡單的HTMl內容。我在哪裏進行更改?

+0

雖然我想你會得到一些答案,但如果你嘗試自己實現它(即使它涉及到直接複製和粘貼代碼並進行調整以查看有效的方法),您可能會得到更好的答案,然後問我們有關具體問題。就好像你要求我們爲你做這項工作一樣。 – 2010-10-06 10:53:40

回答

1

雖然你還沒有發佈任何你自己嘗試這樣做的嘗試,我會盡力幫助你。

如果我理解正確,你想擺脫AJAX,只需添加正常的HTML權利? 那麼,我至少會告訴你在哪裏放置HTML來讓你開始。

你看他們的網站上,在第51行,它說:

$('#personPopupContent').html(' '); 

您可以將NBSP位改爲你想要的任何HTML。 例如:

$('#personPopupContent').html('<strong>My strong text</strong>'); 

您也可以從線53上刪除對74的地方說:

$.ajax({ 
    type: 'GET', 
    url: 'personajax.aspx', 
    data: 'page=' + pageID + '&guid=' + currentID, 
    success: function(data) 
    { 
     // Verify that we're pointed to a page that returned the expected results. 
     if (data.indexOf('personPopupResult') < 0) 
     { 
      $('#personPopupContent').html('<span >Page ' + pageID + ' did not return a valid result for person ' + currentID + '.Please have your administrator check the error log.</span>'); 
     } 

     // Verify requested person is this person since we could have multiple ajax 
     // requests out if the server is taking a while. 
     if (data.indexOf(currentID) > 0) 
     {     
      var text = $(data).find('.personPopupResult').html(); 
      $('#personPopupContent').html(text); 
     } 
    } 
}); 

既然你不會使用它。

我希望對你有幫助。

+0

謝謝..有幫助:) – Serenity 2010-10-10 11:09:54