標籤

ASP.NET MVC (29) Visual C# (15) JQuery (10) Plugins (8) JQuery Plugins (6) JavaScript (6) MySQL (5) CSS (4) LinQ (4) Mac OS (4) CentOS (3) Design Pattern (3) Entity Framework (3) IIS (3) Python (3) Windows (3) php (3) Docker (2) LAMP (2) SQL Server (2) WCF (2) .NET (1) .NET Core (1) AWS (1) Browser (1) GIS (1) IE (1) Internet Security (1) Linux (1) Platform (1) React (1) SEO (1) Testing (1) VMware (1) Windows 7 (1) cookie (1) curl (1) laravel (1) phpBB (1) session (1) 中古屋 (1) 透天 (1) 閒言閒語 (1) 面試 (1) 鳥松 (1)

2011年4月7日 星期四

[JQuery] Jquery livequery 外掛應用 thickbox

官方下載:
http://plugins.jquery.com/node/59/release

=====================
效能實測:
http://www.keakon.net/2009/05/23/LiveQuery%E7%9C%9F%E6%98%AF%E4%B8%AA%E4%B8%8D%E9%94%99%E7%9A%84jQuery%E6%8F%92%E4%BB%B6

簡介:
http://hdj-berkeley.blogspot.com/2009/07/jquery-livequery.html

====================
會用這個外掛是因為原本有使用thickbox的習慣,但是動態新增圖片時就失效了,由於我需要大量動態新增,故使用這個外掛的效果非常好。

thickbox如何套用,首先打thickbox.js:

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk){
    //$(domChunk).click(function () {
    //修改成live
    $(domChunk).livequery('click', function () {  
var t = this.title || this.name || null;
var a = this.href || this.alt;
var g = this.rel || false;
tb_show(t,a,g);
this.blur();
return false;
});
}

沒有留言:

張貼留言