codrgii Posted June 16, 2011 Share Posted June 16, 2011 I want to be able to focus a page when a link is clicked, mainly would like the page to be focused in the middle of the page or is there a way where i can set it where exactly i want it to be focused? Quote Link to comment https://forums.phpfreaks.com/topic/239496-focus-page-on-onclick/ Share on other sites More sharing options...
fugix Posted June 16, 2011 Share Posted June 16, 2011 what exactly do you mean by "focus a page"? Quote Link to comment https://forums.phpfreaks.com/topic/239496-focus-page-on-onclick/#findComment-1230283 Share on other sites More sharing options...
codrgii Posted June 16, 2011 Author Share Posted June 16, 2011 Move the page from a to b, just like the "move page to top" but i would like to set the page focus to the middle or move/set it manually. Quote Link to comment https://forums.phpfreaks.com/topic/239496-focus-page-on-onclick/#findComment-1230587 Share on other sites More sharing options...
Omirion Posted June 17, 2011 Share Posted June 17, 2011 Place a link somewhere in you page like so. <a name="foo">bar</a> This is called a bookmark. Then to be able to go to the place of that link you do this: <a href="#foo">Go to foo</a> From than on you can , for instance place, the bookmark in a div, position the div where ever you want on you page, and give the div 0 opacity or whatever you feel like. Quote Link to comment https://forums.phpfreaks.com/topic/239496-focus-page-on-onclick/#findComment-1230955 Share on other sites More sharing options...
codrgii Posted June 17, 2011 Author Share Posted June 17, 2011 I'm already aware of that method, however when i click on the link it appears "mysite.com/#foo" on the browser bar which i don't want, is there any other methods other than that one? Quote Link to comment https://forums.phpfreaks.com/topic/239496-focus-page-on-onclick/#findComment-1231039 Share on other sites More sharing options...
efficacious Posted June 18, 2011 Share Posted June 18, 2011 not really thats why that method was created in the first place lol Quote Link to comment https://forums.phpfreaks.com/topic/239496-focus-page-on-onclick/#findComment-1231472 Share on other sites More sharing options...
efficacious Posted June 18, 2011 Share Posted June 18, 2011 why don't u want the "#var" in your link? You can still send information post refresh it doesn't hurt anything.. the only thing it does is maybe not look as clean in the url.. but lets be honest who gives a shit? Your users don't i'm sure. There is another option but believe me you don't wana bother.. it requires an extensive amount of javascript to track lots of variables on the page. I'm sure your users would rather have your site be fast than slow as shit and a slightly cleaner url Quote Link to comment https://forums.phpfreaks.com/topic/239496-focus-page-on-onclick/#findComment-1231473 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.