X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=deb214bcd7f3f34ea4507a6a9c06920a9e4f0c84;hb=3527e8f6745786e65dc209f1518372f3270a9920;hp=67dfd6b52c4dde42e14774483531d041f76d90d7;hpb=301e2b64937cf1b03899f0583a9c6de1086820a5;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 67dfd6b..deb214b 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -493,7 +493,7 @@ jQuery.fn = jQuery.prototype = { * representation of itself. Eg. fontWeight, fontSize, fontFamily, borderWidth, * borderStyle, borderBottomWidth etc. * - * @test ok( $('#foo').css("display") == 'block', 'Check for css property "display"'); + * @test ok( $('#main').css("display") == 'none', 'Check for css property "display"'); * * @name css * @type Object @@ -1160,52 +1160,6 @@ jQuery.fn = jQuery.prototype = { }, /** - * Executes the first callback for every element that fits the expression - * and executes the second callback for every element that does not fit - * the expression. - * - * @example $('div').ifelse(':visible', - * function() { $(this).slideUp(); }, - function() { $(this).slideDown(); } - * ); - * @desc Slides down all visible div elements and slides down all others - * - * @test var checked = 0, notChecked = 0; - * var inputChecked = $(':input').ifelse(':checked', - * function() { checked++; }, - * function() { notChecked++ } - * ); - * ok( checked == 2, 'Check is if/else: Count checked elements' ); - * ok( notChecked == 12, 'Check is if/else: Count unchecked elements' ); - * - * $('#first, #foo, #ap').ifelse('p', - * function() { $(this).html('me == p') }, - * function() { $(this).html('me != p') } - * ); - * ok( $('#first').text() == 'me == p', 'Check filter-if-clause' ); - * ok( $('#foo').text() == 'me != p', 'Check else-clause' ); - * ok( $('#ap').text() == 'me == p', 'Check filter-if-clause' ); - * - * @name ifelse - * @type jQuery - * @param String expression The expression with which to filter - * @param Function ifCallback Called for elements that fit the expression - * @param Function elseCallback Called for elements that don't fit the expression - * @cat DOM/Traversing - */ - ifelse: function(expr, ifCallback, elseCallback) { - var ifCallback = ifCallback || function() {}; - var elseCalllback = elseCallback || function() {}; - return this.each(function() { - if($(this).is(expr)) { - ifCallback.apply(this); - } else { - elseCallback.apply(this); - } - }); - }, - - /** * * * @private