thewooleymammoth Posted October 30, 2008 Share Posted October 30, 2008 i have a page that i need to focus on the the image dynamcially essentually the code is liek this foreach ($list_of_images as $image) { $selectimage=$_GET['image']; if ($image == $selectimage) { //i want the the page to automatically load with this at the top of the screen becuase there could potentially be a huge list of images and scrolling down each time gets annoying echo " <img src='$image'><br>need page to focus here on load<br>"; } else { echo "<a href='image.php?image='$image'>other image titles<br>"; } } Ive been searching for a while and cant find the code or a tutorial to do this, im not really interested in learning js but im told js is the best way to do this so if anyone can just tell me the code or something that would be AWESOME an example of the page im trying to improve is http://fatalinjury.org/vf.php?name=5wooley4@gmail.com notice the scrolling down the page is gets very annoying Quote Link to comment Share on other sites More sharing options...
xtopolis Posted October 30, 2008 Share Posted October 30, 2008 You the anchor tag, name attribute, and access the url with # at the end url is: http://www.yoursite.com/page.html#thing1 <a href="something.html" name="thing1">text</a> Should scroll to that , if I'm reading correctly what you want. Quote Link to comment Share on other sites More sharing options...
thewooleymammoth Posted October 30, 2008 Author Share Posted October 30, 2008 foreach ($list_of_images as $image) { $selectimage=$_GET['image']; if ($image == $selectimage) { //i want the the page to automatically load with this at the top of the screen becuase there could potentially be a hugelist of images and scrolling down each time gets annoying echo " <img src='$image' name='open'><br>need page to focus here on load<br>"; } else { echo "<a href='image.php?image=$image#name=open'>other image titles<br>"; } } so the code should look like this? Quote Link to comment Share on other sites More sharing options...
thewooleymammoth Posted October 30, 2008 Author Share Posted October 30, 2008 oh i got it thank you very much that was exactly what i was looking for! Quote Link to comment Share on other sites More sharing options...
xtopolis Posted October 30, 2008 Share Posted October 30, 2008 Nice, good job. Topic solved this bad boy (button on bottom left) Quote Link to comment Share on other sites More sharing options...
thewooleymammoth Posted October 31, 2008 Author Share Posted October 31, 2008 sorry forgot taht part Quote Link to comment 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.