🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #50351

Re: Czekanie na załadowanie JS?

#50351
From: Paweł Piskorz
Date: Sun, 17 Oct 2010 11:50
43 lines
2355 bytes
On 2010-10-17 10:31, Tdobe wrote:
> Korzystam sobie z jQuery z modułu thickbox (jeśli link ma taką klasę
> okno otwierane jest w osobnym divie jako np. modalne)
>
> przyklad linku:<a href="adres" class="thickbox">otworz okienko
> modalne</a>
>
> Tylko jest mały problem, jak za szybko kliknę w takiego linka (strona
> się jeszcze nie załoadowała... lub moduł thickbox.js nie zadziałał...
> jeszcze) to otwiera mi sie link w sposób standardowy.

W thickbox.js:
/*!!!!!!!!!!!!!!!!! edit below this line at your own risk 
!!!!!!!!!!!!!!!!!!!!!!!*/

//on page load call tb_init
/*$(document).ready(function(){   */ // tę linię wywal
	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to 
apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;
/*});*/ // tę linię wywal

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk){
/*	$(domChunk).click(function(){*/ // tę linię wywal
	$(domChunk).live( 'click', function(){ // tę linię dodaj
	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;
	});
}

I pamiętaj żeby jQuery i thickbox były w <head/>


-- 
message[autor="PablO"]::after {
	content:"Pozdrawiam";
}
Technical Details
Message-ID: <i9entk$hde$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <cb67c9db-29cc-4091-97ce-cc5d4310aac2@l14g2000yqb.googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: Paweł Piskorz <nie.ma.maila@psikre.nie?>
Newsgroups: pl.comp.lang.javascript
Subject: Re: Czekanie na załadowanie JS?
Date: Sun, 17 Oct 2010 13:50:00 +0200
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 43
Message-ID: <i9entk$hde$1@inews.gazeta.pl>
References: <cb67c9db-29cc-4091-97ce-cc5d4310aac2@l14g2000yqb.googlegroups.com>
NNTP-Posting-Host: 213-238-86-26.adsl.inetia.pl
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1287316213 17838 213.238.86.26 (17 Oct 2010 11:50:13 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Sun, 17 Oct 2010 11:50:13 +0000 (UTC)
X-User: uhorek
In-Reply-To: <cb67c9db-29cc-4091-97ce-cc5d4310aac2@l14g2000yqb.googlegroups.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 Hamster/2.1.0.11
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit