pQuery\DomNode::toggleClass PHP 메소드

toggleClass() 공개 메소드

public toggleClass ( $classname, $switch = null )
    public function toggleClass($classname, $switch = null)
    {
        if ($switch === true) {
            $this->addClass($classname);
        } elseif ($switch === false) {
            $this->removeClass($classname);
        } else {
            if ($this->hasClass($classname)) {
                $this->removeClass($classname);
            } else {
                $this->addClass($classname);
            }
        }
        return $this;
    }
DomNode