Article View: pl.comp.lang.javascript
Article #50573Wlasny plugin jQuery i this
From: aaaa
Date: Wed, 16 Feb 2011 19:23
Date: Wed, 16 Feb 2011 19:23
41 lines
1626 bytes
1626 bytes
Hej
Tworze wlasny plugin do jQuery:
$('.piesek').mojPlugin(
{
onChange: function(a,b,c)
{
$(this).val(a+b+c);
}
});
W pluginie mam:
if (settings.onChange != null)
{
settings.onChange(a, b, c);
}
oraz
var settings =
{
'onChange' : null
};
oraz
init : function (options)
{
// If options exist, lets merge them with our default settings
if ( options )
{
$.extend( settings, options );
}
I teraz (this) z $(this).val(a+b+c); odnosi sie do mojego pluginu, a nie do
pola (.piesek).
Mozna jakims trikiem zrobic, zeby odnosilo sie do .piesek?
--
A
Technical Details
Message-ID:
<4d5c2420$0$2459$65785112@news.neostrada.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!news-out.readnews.com!transit4.readnews.com!216.40.28.145.MISMATCH!novia!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!news-out.readnews.com!transit4.readnews.com!216.40.28.145.MISMATCH!novia!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail From: "aaaa" <aaaa@aaaaaaaaaaaaaaaaaaa.com> Newsgroups: pl.comp.lang.javascript Subject: Wlasny plugin jQuery i this Date: Wed, 16 Feb 2011 20:23:32 +0100 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 Lines: 42 Message-ID: <4d5c2420$0$2459$65785112@news.neostrada.pl> Organization: Telekomunikacja Polska NNTP-Posting-Host: 83.9.49.17 X-Trace: 1297884192 unt-rea-a-01.news.neostrada.pl 2459 83.9.49.17:3126 X-Complaints-To: abuse@news.neostrada.pl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit