relative position in pixels

This commit is contained in:
David Botton 2021-12-05 22:06:38 -05:00
parent 8fcd352c07
commit edca73a195
2 changed files with 24 additions and 0 deletions

View file

@ -490,6 +490,28 @@ spell checking if Editable is also true."))
(setf (property obj "lang") value))
(defsetf language-code set-language-code)
;;;;;;;;;;;;;;;;;;;
;; position-left ;;
;;;;;;;;;;;;;;;;;;;
(defgeneric position-left (clog-element)
(:documentation "Get position-left. The relative left border of an element
in pixels (css left in pixels)."))
(defmethod position-left ((obj clog-element))
(parse-integer (jquery-query obj "position().left" :default-answer 0) :junk-allowed t))
;;;;;;;;;;;;;;;;;;
;; position-top ;;
;;;;;;;;;;;;;;;;;;
(defgeneric position-top (clog-element)
(:documentation "Get position-top. The relative top border of an element
in pixels (css top in pixels)."))
(defmethod position-top ((obj clog-element))
(parse-integer (jquery-query obj "position().top" :default-answer 0) :junk-allowed t))
;;;;;;;;;;;;;;;;;
;; client-left ;;
;;;;;;;;;;;;;;;;;

View file

@ -196,6 +196,8 @@ embedded in a native template application.)"
(text-direction-type type)
(text-direction generic-function)
(language-code generic-function)
(position-left generic-function)
(position-top generic-function)
(client-left generic-function)
(client-top generic-function)
(client-width generic-function)