Jump to content

remembering positions in a list


freelance84

Recommended Posts

I've noticed on this and a few other websites a nifty little trick... 

 

When scrolling down a page and I find a thread i'm interested in, I click on it. It then takes me to this thread.

When I press back from this thread, the page has already scrolled down the list to where the thread link was.

 

How is this down? I've disable all cookies and javascript whilst on phpFreaks but it still works! Is it something to do with page anchors?

Link to comment
https://forums.phpfreaks.com/topic/207026-remembering-positions-in-a-list/
Share on other sites

oh  :-[

 

Well then I have a question...

 

There is a section on my site which contains a list of names (these can be anything from people to fictional characters), next to each name is two buttons, "edit" and "delete".

 

When a user presses delete it reloads the script and the name which is to be deleted...

The buttons now read "edit" and "deleting" (the deleting button also changes type from submit to button). Under this there is a "Are you sure you wish to delete? Yes No".

 

The problem is, this list can be 50 long and when the page reloads the user then has to scroll down to find the "Are you suer you want to delete" question. Is there anything else I can send with the original "delete" button which would mean the page jump automatically without the user having to scroll?

 

Sort of like an internal link, only different

 

try using a hashtag i.e. <a name="r-u-sure"></a> and place that clsoe to your confirmation area

When you repload your page add in #r-u-sure at the end of your url like this: repload.php#r-u-sure.

 

Why dont you use javascript confirm() to ask for confirmation when deleting?

That's brilliant! It worked perfectly!

 

Trying to get the site working completely first without javascript. After which I intend to start to include javascript. Also I only started learning php html mysql css in March so I really want to get a solid grip on those first before learning Javascript.

 

Thanks again  :D

Archived

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

×
×
  • Create New...

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.