Jump to content

Archived

This topic is now archived and is closed to further replies.

Endrew

Setting Cursor Position in Browser

Recommended Posts

Is there a way to place anchor in specific location in browser? Like using X,Y coordinate.

Share this post


Link to post
Share on other sites
Yes. Here is an example: [code]<a href='http://phpfreaks.com' style='position:absolute; left: 20; top: 77;'>PHP Freaks</a>[/code]

Share this post


Link to post
Share on other sites
Not obvious quite what you want, but html anchors might be what you want (as in somepage.html#top). If not, then maybe you want to use the onLoad function to place the focus on a particular form element, or to use the javascript scrollTo(x,y) function.

All depends what you're really trying to accomplish.

Share this post


Link to post
Share on other sites
Ya' learn something new everyday! This is a pretty cool concept.

Updating Daniel0's code...

[code]<a name="anchor1" style="position:absolute; left: 20; top: 500;">anchor1</a>[/code]

This makes the anchor not a hypertext link. Rather, it is an anchor that can be accessed like [i]/index.htm#anchor1[/i].

------
Endrew, is this what you're trying to do, or are you trying to put a blinking cursor in an [b]input[/b] field (like Google does)?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.