Aklımda Kalası Kelimeler

* давайте работать вместе
* Zarf ve Mazruf, Zerafet(xHoyratlık) ile aynı kökten(za-ra-fe) gelir
* Bedesten
* Suç subuta ermiştir - Suç sabit olmuştur
EACH etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
EACH etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

9 Mart 2010 Salı

JQuery .each

Ref: http://api.jquery.com/jQuery.each/


$.each($("#divBulunanResimler div"), function(index, div) {
alert($(div).html());
$(div).attr.hide();
});

$.each([52, 97], function(index, value) {
alert(index + ': ' + value);
});


var map = {
'flammable': 'inflammable',
'duh': 'no duh'
};
$.each(map, function(key, value) {
alert(key + ': ' + value);
});

27 Şubat 2009 Cuma

Birazda benden JQUERY

JQUERY
input tipi text olan elementleri 0. formda bulacak ve her birisi için dönecek.

function donFonksiyon() {
$.each($("input:text", document.forms[0]), function() {
alert(this.id);
}, null);
}


Select değişti seçili olanın text ve value sunu yazalım.

$("select").change(
function()
{
var SelectIdsi = this.id;
var selectedIndex = this.selectedIndex;
var seciliText = this.options[this.selectedIndex].text;
var seciliValue = this.value;
});

Select içinde bir option seçmek:

$('#select').selectOptions('secilecekOptionValue');


Seçili elementin değeri (bir kenarda dursun, Ref:JQUERY)

/* get the value from a dropdown select */
$('select#foo option:selected').val();

/* get the value from a checked checkbox */
$('input:checkbox:checked').val();

/* get the value from a set of radio */
$('input:radio[name=bar]:checked').val(); buttons



/* CheckBox ya da Radio seçiliyse değerini getir:
$("#rbCB:checked").val()

/* Radio seçilmiş mi?
$("#rbCB").is(":checked");

/* Using Name for selector */
$("input[@name='chkBox']").click(function(){
// your code here
});

/* Using ID for selector */
$("#chkBox").change(function(){
// your code here
});



Sayfanın Adresi: http://www.techiegyan.com/?p=112

Radio Button:

<input name="rdio" value="a" checked="checked" type="radio">
<input name="rdio" value="b" type="radio">
<input name="rdio" value="c" type="radio">

Handling change event for Radio buttons:
Click event can be handled similarly. ID can not be used here because Radio buttons are used for single selection from a group where all input fields of group should have same name.


$("input[@name='rdio']").change(function(){
if ($("input[@name='rdio']:checked").val() == 'a')
// Code for handling value 'a'
else if ($("input[@name='rdio']:checked").val() == 'b')
// Code for handling value 'b'
else
// Code for handling 'c'
});

Ayrıca eburhan.com da harika anlatımla JQUERY ziyafeti var duyrulur.