/** * Return a style property on the first matched element. */ public String css(String name) { return css(name, true); }
/** * Set the height style property of every matched element. It's useful for using 'percent' or 'em' * units Example: $(".a").height("100%") */ public GQuery height(String height) { return css("height", height); }
/** * Set the width style property of every matched element. It's useful for using 'percent' or 'em' * units Example: $(".a").width("100%") */ public GQuery width(String width) { return css("width", width); }
/** * Return a style property on the first matched element using type-safe enumerations. * * Ex : $("#myId").css(CSS.BACKGROUND_COLOR); */ public String css(HasCssValue property) { return css(property, true); }
/** * Set CSS a single style property on every matched element using type-safe enumerations. This * method allows you to set manually the value or set <i>inherit</i> value * * ex : * * <pre class="code"> * $(#myId).css(CSS.TEXT_DECORATION, CSS.INHERIT); * </pre> */ public GQuery css(TakesCssValue<?> cssProperty, String value) { return css(cssProperty.getCssName(), value); }
public boolean f(Element e, int index) { GQuery g = GQuery.$(e); String position = g.css("position", true); return ("relative".equals(position) || "absolute".equals(position) || "fixed" .equals(position)) && isOverflowEnabled(g); } });
@Override public void applyValue(GQuery g, double progress) { int[] result = new int[3]; for (int i = 0; i < 3; i++) { int composante = (int) Math.round(startColor[i] + progress * (endColor[i] - startColor[i])); result[i] = Math.max(0, Math.min(255, composante)); } String value = RGBColor.rgb(result[0], result[1], result[2]).getCssName(); g.css(cssprop, value); }
public void applyValue(GQuery g, double progress) { double ret = (start + ((end - start) * progress)); String val = ("px".equals(unit) ? ((int) ret) : ret) + unit; if ("scrollTop".equals(cssprop)) { g.scrollTop((int) ret); } else if ("scrollLeft".equals(cssprop)) { g.scrollLeft((int) ret); } else if (attribute != null) { g.attr(attribute, val); } else { g.css(cssprop, val); } }
@Override protected void initSearchElement(int ddWidth, boolean isHidden) { super.initSearchElement(ddWidth, isHidden); int searchFieldWidth = computeSearchFieldWidth(ddWidth, isHidden); if (searchFieldWidth != -1) { getSearchField().css("width", searchFieldWidth + "px"); } }
@Override protected void initSearchElement(int ddWidth, boolean isHidden) { super.initSearchElement(ddWidth, isHidden); int searchFieldWidth = computeSearchFieldWidth(ddWidth, isHidden); if (searchFieldWidth != -1) { getSearchField().css("width", searchFieldWidth + "px"); } }
protected void resultsHide() { if (!resultsShowing) { return; } if (selectedItem != null) { selectedItem.removeClass(css.chznSingleWithDrop()); } resultClearHighlight(); fireEvent(new HidingDropDownEvent(this)); dropdown.css(isRTL ? "right" : "left", HORIZONTAL_OFFSET + "px"); dropdown.css("top", VERTICAL_OFFSET + "px"); container.removeClass(css.resultAbove()); resultsShowing = false; }
protected void resultsHide() { if (!resultsShowing) { return; } if (selectedItem != null) { selectedItem.removeClass(css.chznSingleWithDrop()); } resultClearHighlight(); fireEvent(new HidingDropDownEvent(this)); dropdown.css(isRTL ? "right" : "left", HORIZONTAL_OFFSET + "px"); dropdown.css("top", VERTICAL_OFFSET + "px"); container.removeClass(css.resultAbove()); resultsShowing = false; }
public BorderColorFx(Element e, String endColorString) { endColor = parseColor(endColorString); startColors = JsNamedArray.create(); GQuery g = GQuery.$(e); for (String border : borderColorProperties) { int[] startColor = parseColor(g.css(border, true)); startColors.put(border, startColor); } }
private void resultsHide() { if (!resultsShowing) { return; } if (!isMultiple) { selectedItem.removeClass(css.chznSingleWithDrop()); } resultClearHighlight(); fireEvent(new HidingDropDownEvent(this)); dropdown.css(isRTL ? "right" : "left", "-9000px"); resultsShowing = false; }
private void winnowResultsClear() { searchField.val(""); GQuery lis = searchResults.find("li"); for (Element li : lis.elements()) { GQuery $li = $(li); if ($li.hasClass(css.groupResult())) { $li.css("display", ""); } else if (!isMultiple || !$li.hasClass(css.resultSelected())) { resultActivate($li); } } }