Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3611934
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:56:12+00:00 2026-05-18T21:56:12+00:00

I have downloaded the jquery scroll script (http://www.position-absolute.com/articles/better-html-anchor-a-jquery-script-to-slide-the-scrollbar/) which will scroll to your anchor

  • 0

I have downloaded the jquery scroll script (http://www.position-absolute.com/articles/better-html-anchor-a-jquery-script-to-slide-the-scrollbar/) which will scroll to your anchor when you click a link. However, I was wondering if there was any way to customise this using php/jquery to grab an item id from the URL, then scroll to that item id when the page loads?

Here’s the scroll js:

$(document).ready(function() {
    $("a.anchorLink").anchorAnimate()
});

jQuery.fn.anchorAnimate = function(settings) {

    settings = jQuery.extend({
        speed : 1100
    }, settings);   

    return this.each(function(){
        var caller = this
        $(caller).click(function (event) {  
            event.preventDefault()
            var locationHref = window.location.href
            var elementClick = $(caller).attr("href")

            var destination = $(elementClick).offset().top;
            $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
                window.location.hash = elementClick
            });
            return false;
        })
    })
}

Here’s an example URL with the itemid in it:

http://www.somesite.com/index.php?view=list&itemid=3

^^ so basically I need the itemid grabbed (using php I presume?) and then tell jQuery to scroll to that anchor:

<a name="3" id="3"></a>

Any help would be appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:56:13+00:00Added an answer on May 18, 2026 at 9:56 pm

    No need for PHP here at all! You’re in luck! There is a jQuery plug-in that can grab and parse the query string. http://plugins.jquery.com/project/query-object. If you want to roll your own, just test the location.href property in JavaScript as it contains the query string. http://www.w3schools.com/jsref/prop_loc_href.asp

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some content sliding here. http://www.smallsharptools.com/downloads/jQuery/Slider/slider.html The HTML structure is simple. There is
I've downloaded a JQuery plugin for a mousehold event. http://remysharp.com/2006/12/15/jquery-mousehold-event/ I have this div
Today I just have downloaded a custom Jquery UI archive from http://jqueryui.com/download I extracted
I have downloaded the Jquery UI with Start theme. Demo is here: http://jqueryui.com/demos/datepicker/ I
I have downloaded the two releases of python 2.6.8 from here http://www.python.org/getit/releases/2.6.8/ and I
I need something like this: http://hitconsultants.com/dragscroll_scrollsync/scrollpane.html I have an area that should be dragscrollable
I'm trying to use the jqueryui dialog ( http://docs.jquery.com/UI/Dialog ) within my html page.
I have downloaded an auto completion(jQuery script) form from net. I am using wamp
i am using jquery for first time in a phonegap eclipse application.i have downloaded
I have downloaded the JQuery plugin EasySlider1.7 . I have the basics working but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.