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/[email protected] notice the scrolling down the page is gets very annoying Link to comment https://forums.phpfreaks.com/topic/130680-solved-simple-problemi-think/ 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. Link to comment https://forums.phpfreaks.com/topic/130680-solved-simple-problemi-think/#findComment-678195 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? Link to comment https://forums.phpfreaks.com/topic/130680-solved-simple-problemi-think/#findComment-678785 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! Link to comment https://forums.phpfreaks.com/topic/130680-solved-simple-problemi-think/#findComment-678791 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) Link to comment https://forums.phpfreaks.com/topic/130680-solved-simple-problemi-think/#findComment-678796 Share on other sites More sharing options...
thewooleymammoth Posted October 31, 2008 Author Share Posted October 31, 2008 sorry forgot taht part Link to comment https://forums.phpfreaks.com/topic/130680-solved-simple-problemi-think/#findComment-678973 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.