what part of my code is wrong I keep getting invalid argument
I want to position the div element outside the document window on the left.
jQuery(this).css({"left": (jQuery(document).css("left") - jQuery(form).width())});
what part of my code is wrong I keep getting invalid argument
I want to position the div element outside the document window on the left.
jQuery(this).css({"left": (jQuery(document).css("left") - jQuery(form).width())});
Might want to tell "left" what measure your statement is in (px, %, etc)
document
is the HTMLDocument instance. It's not an HTMLElement instance so no CSS styles apply to it. Consequently you can't read anyleft
style from it. You can trydocument.documentElement
(or$('html')
) to get the root element child of the document, but I'm not sure what use you think reading itsleft
style will be. (In reality: you'll get nothing.)Are you really trying to position a div outside of the browser window? Obviously this cannot work; the whole idea of the window is that it constrains, clips and scrolls the document content inside it.
If you wanted to display content outside of the current browser window you would have to
window.open
a pop-up at a position based on the current window's screen position (screenLeft
/screen.left
etc). But pop-ups have many serious usability drawbacks and browsers limit their use for this reason.