views:

27

answers:

2

I have a hyperlink which I am trying to reposition on the page using

$('#myLink').position({ my: "center", at: "center", of: "#contentArea", offset: "30 130" });

However it's not being placed in the new position. My page is a complicated html so I can't post it. I tried different target elements but same results (both in IE8 & FF). I am using jQuery 1.4.2. There are no errors in the error console. $('#myLink').length = 1

Are there limitations for the position() function? How can the browser window or document be used as a target element?

+1  A: 

According to the jQuery docs, .position() is a read-only method.

Funkatron
It's the UI one, not core.http://docs.jquery.com/UI/Position
Tony_Henrich
+3  A: 

.position() is read only. Use the .css() function to set positions.

Edit:

After looking further I see that you are referring to the following:

http://docs.jquery.com/UI/Position

That being said, I think you may need to include the jQuery UI library in order for this to work.

Try including the following in the head of your page:

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"&gt;&lt;/script&gt;
Ender
I had the UI script reference in my code but the js file location was off.
Tony_Henrich