I really hope someone might help!

This site: http://www.richardmilne.net

I've got a wordpress site established to make use of the iinclude wordpress plugin to show individual pages all around the top of the page. This is effective but I'm not going customers to gain access to individual pages, ie "site.com/page". If your user visits "site.com/page" (eg from the google listing), I would like these to be rerouted to "site.com/#location", possess the window scroll towards the correct location, and trigger the jquery slider. (see link above)

I had been thinking about using .htaccess to redirect the page. Next from what I have collected I have to use a little of javascript chicanery to trigger the preferred div to slip open. During my situation this is just a situation of altering it's class to "toggle_initial", that the jquery script animates after an 800ms delay on-page load. (again, begin to see the link above, which already uses this to load the "recent posts" section when you initially visit. So you realize this can be a jquery-UI wordpress plugin).

It is the bit in the centre I can not get my mind round. What I have read to date informs me I can not do that with php that was my first approach, as "PHP_SELF" ignores the "#location" little bit of the URL. This leaves javascript as much as the job of altering the div's class, I have found these links which I am sure contain some hints for me personally, but like a javascript novice I can not make mind nor tail of methods to use these to my website:

Adding a class to an a element with a particular href using hash

doing substring in window.location.hash

Any tips could be greatly appreciated, cheers!

You'll most likely desire to use JQuery window.location.hash to obtain any values following the hash tag.

Visit a couple of lessons below:

Step One. Obtain the anchor element in the url using javascript. window.location.href

Step Two. Alter the class of the target h2 using jQuery. Code assumes that div id and anchor are the same.

$(document).ready( function() {
    var anchor = yourCodeToFindAnchor;
    $('#' + anchor).addClass('active');

I suggest http://benalman.com/projects/jquery-bbq-plugin/

It easily enables you to definitely connect all type of jQuery actions towards the hash object.

This will enable you to get began: http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/