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
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

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.