Inciphisa inani leebhokisi zokutshekisha ezinokujongwa

Into elungileyo malunga ne-jQuery kukuba sinokwandisa ithala leencwadi ngokulula, kwaye namhlanje siza kuyandisa ukongeza umsebenzi oza kusivumela ukuba sinciphise elona nani liphezulu leebhokisi zokutshekisha, into enomdla ngokwenene.

Inyathelo lokuqala: Yongeza umdaCheckbox umsebenzi kwi-jQuery:

$ .fn.limitarCheckbox = umsebenzi (num) {

var khangela = oku;

this.click (function () {return (check.filter (": checked"). ubude <= num);}); / * Sithatha inani lokutshekishwa kwaye sijonge ukuba ziyadlula kwiparameter * /
}
Inyathelo lesibini: Senza umsebenzi kuxwebhu.
$ ("Igalelo: ibhokisi yokukhangela"). LimitCheckbox (6);
/ * Singasebenzisa nawuphi na umkhethi ukuba nje uneebhokisi zokukhangela ... kwaye ungayikhawulela kuyo nantoni na oyifunayo * /
Ndiyathemba ukuba iyakunceda kwiprojekthi, kuye kwafuneka ndiyenze ngokungxamisekileyo ngoku kwaye andinakukunceda kodwa ndikuthumele yona, ziyilo zehlabathi!

Umxholo wenqaku uyabambelela kwimigaqo yethu imigaqo yokuziphatha yokuhlela. Ukuxela impazamo cofa apha.

Izimvo ezi-2, shiya ezakho

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa. ezidingekayo ziphawulwe *

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.

  1.   U-Luardo Luis Eduardo sitsho

    ungakhankanya enye into efana nayo? nayiphi na eminye imizekelo yekhowudi?

  2.   I-Santigo sitsho

    ENKULU!, Enkosi ngegalelo, ndiqala nge-php, jQuery kunye neJavaScrit kwaye undincede ndayiqonda indlela yokuyisebenzisa kweminye imisebenzi, enkosi !!