Need to use a string to scroll to a div with the same ID, without using anchor tags
<p>I have a link that when clicked will get the HREF of the selected link, and turn it into an ID.</p>

<p>For example</p>

<p>/limo/#Vehicles will generate "#Vehicles" on click (as a string), and should scroll to the ID called "Vehicles"</p>

<p>/limo/#Vehicles/Chrysler will generate "#Chrysler" on click (as a string), and should scroll to the ID called "Chrysler"</p>

<p>Currently, when I select the link, it does not scroll, but the alerts are showing that the "#Vehicles," and "#Chrysler" strings are correctly being formed.</p>

<p>I tried to get the position of the id, and scroll to the coordinates, but that didn't work either.</p>

<p>Here is what I have...</p>

<pre><code>[code]

if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {


function backupNavigation_click(clicked_href)

{



var abc = clicked_href.substring(clicked_href.lastIndexOf('/') +1);

if (abc.match("^#")) {

var goTo = abc;
alert (goTo);

function(e) {
    // target element id
    var id = goTo;

    // target element
    var $id = $(id);
    if ($id.length === 0) {
        return;
    }

    // prevent standard hash navigation (avoid blinking in IE)
    e.preventDefault();

    // top position relative to the document
    var pos = $(id).offset().top;

    // animated top scrolling
    $('body, html').animate({scrollTop: pos});
}

}
else{
var goTo = "#" + abc;

alert (goTo);


function(e) {
    // target element id
    var id = goTo;

    // target element
    var $id = $(id);
    if ($id.length === 0) {
        return;
    }

    // prevent standard hash navigation (avoid blinking in IE)
    e.preventDefault();

    // top position relative to the document
    var pos = $(id).offset().top;

    // animated top scrolling
    $('body, html').animate({scrollTop: pos});
}


}

}

}else
{
if (window.innerWidth&gt; 479) {
 $('head').append('   &lt;script type="text/javascript" src="js/jquery.fullPage.js"&gt;');
}

            $(document).ready(function()
            {
                $('#fullpage').fullpage(
                {
                    anchors: ['Home', 'Events', 'Vehicles', 'Testimonials', 'Specials', 'AboutUs', 'Quotes'],
                    sectionsColor: ['none', 'none', 'none','none', 'none', 'none', 'none'],
                    scrollOverflow: true
                });
            });



}

[/code]
</code></pre>

<p>Here is a link to the site I am working on, if you test for a mobile device, you should see what I am talking about, the desktop version works fine.</p>

<p><a href="http://lookupblue.com/elclimo" rel="nofollow">http://lookupblue.com/elclimo</a></p>

<pre><code> &lt;script type="text/javascript"&gt;


if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {


function backupNavigation_click(clicked_href)

{



var abc = clicked_href.substring(clicked_href.lastIndexOf('/') +1);

if (abc.match("^#")) {

var goTo = abc;
alert (goTo);

$('a').on("click", function(e) {
        // prevent default state change
        e.preventDefault();
    // get href of clicked
        var abc = $(this).attr('href');
    // Find last '/' and get everything after
    abc = abc.substring(abc.lastIndexOf('/')+1, abc.length);

    // If '#' found then chop off
    if(abc.indexOf('#') &gt; -1) {
        abc = abc.substring(1, abc.length);
    }
    console.log(abc);

    // Find matching with matching id
    var pos = $('#' + abc).offset().top;
    console.log(pos);

    // Scroll to it
    $('html, body').animate({
        scrollTop: pos
    }, 400);
})








}
else{
var goTo = "#" + abc;

alert (goTo);

$('a').on("click", function(e) {
        // prevent default state change
        e.preventDefault();
    // get href of clicked
        var abc = $(this).attr('href');
    // Find last '/' and get everything after
    abc = abc.substring(abc.lastIndexOf('/')+1, abc.length);

    // If '#' found then chop off
    if(abc.indexOf('#') &gt; -1) {
        abc = abc.substring(1, abc.length);
    }
    console.log(abc);

    // Find matching with matching id
    var pos = $('#' + abc).offset().top;
    console.log(pos);

    // Scroll to it
    $('html, body').animate({
        scrollTop: pos
    }, 400);
})


}

}







}else
{
if (window.innerWidth&gt; 479) {
 $('head').append('   &lt;script type="text/javascript" src="js/jquery.fullPage.js"&gt;');
}



            $(document).ready(function()
            {
                $('#fullpage').fullpage(
                {
                    anchors: ['Home', 'Events', 'Vehicles', 'Testimonials', 'Specials', 'AboutUs', 'Quotes'],
                    sectionsColor: ['none', 'none', 'none','none', 'none', 'none', 'none'],
                    scrollOverflow: true
                });
            });



}



&lt;/script&gt;


    &lt;/head&gt;

    &lt;body&gt;

        &lt;div class="container"&gt;

            &lt;div id="TopNav" class="slide"&gt;
                &lt;header class="slide"&gt;
                    &lt;!--    Add "slideRight" class to items that move right when viewing Nav Drawer  --&gt;
                    &lt;ul id="navToggle" class="burger slide"&gt;
                        &lt;!--    Add "slideRight" class to items that move right when viewing Nav Drawer  --&gt;
                        &lt;li&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;/li&gt;
                    &lt;/ul&gt;
                    &lt;h1&gt;EXQUISITE LIMOUSINE&lt;/h1&gt;
                &lt;/header&gt;

                &lt;nav class="slide"&gt;
           &lt;ul&gt;
        &lt;li class="MenuHeading active" data-menuanchor="Home"&gt;&lt;a href="#Home" onclick="backupNavigation_click(this.href);"&gt;HOME&lt;/a&gt;&lt;/li&gt;
        &lt;li class="MenuHeading" data-menuanchor="Events"&gt;&lt;a href="#Events" onclick="backupNavigation_click(this.href);"&gt;EVENTS&lt;/a&gt;&lt;i id="eTog" class="fa fa-toggle-off"&gt;&lt;/i&gt;
            &lt;ul class="capo"&gt;
                &lt;li class="lilbuddy ace"&gt;&lt;a href="#Events/Weddings" onclick="backupNavigation_click(this.href);"&gt;Weddings&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Events/Quinceaneras" onclick="backupNavigation_click(this.href);"&gt;Quinceaneras&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Events/SpecialEvent" onclick="backupNavigation_click(this.href);"&gt;Special Events&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Events/School" onclick="backupNavigation_click(this.href);"&gt;School Events&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Events/Corporate" onclick="backupNavigation_click(this.href);"&gt;Corporate Events&lt;/a&gt;
                        &lt;/li&gt;
            &lt;/ul&gt;
        &lt;/li&gt;
        &lt;li class="MenuHeading" data-menuanchor="Vehicles"&gt;&lt;a href="#Vehicles" onclick="backupNavigation_click(this.href);"&gt;VEHICLES&lt;/a&gt;&lt;i id="vTog" class="fa fa-toggle-off"&gt;&lt;/i&gt;
            &lt;ul class="boss"&gt;
                    &lt;li class="lilbuddy ace"&gt;&lt;a href="#Vehicles/Escalade" onclick="backupNavigation_click(this.href);"&gt;4 Guests - Escalade&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/Chrysler" onclick="backupNavigation_click(this.href);"&gt;10 Guests - 300C&lt;/a&gt;
                        &lt;/li&gt;
&lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/Frankenstein" onclick="backupNavigation_click(this.href);"&gt;22 Guests - FrankNstein&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/Hummer" onclick="backupNavigation_click(this.href);"&gt;22 Guests - Hummer&lt;/a&gt;
                        &lt;/li&gt;

                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/MadMax" onclick="backupNavigation_click(this.href);"&gt;25 Guests - Mad Max&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/Bella" onclick="backupNavigation_click(this.href);"&gt;26 Guests - Bella&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/KIT" onclick="backupNavigation_click(this.href);"&gt;26 Guests - Kit&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/Rockstar" onclick="backupNavigation_click(this.href);"&gt;28 Guests - Rock Star&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/MrBubbles" onclick="backupNavigation_click(this.href);"&gt;28 Guests - Bubbles&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/Uno" onclick="backupNavigation_click(this.href);"&gt;30 Guests - Uno&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/Hera" onclick="backupNavigation_click(this.href);"&gt;30 Guests - Hera&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li class="lilbuddy"&gt;&lt;a href="#Vehicles/Voyager" onclick="backupNavigation_click(this.href);"&gt;31 Guests - Shuttle&lt;/a&gt;
                        &lt;/li&gt;
            &lt;/ul&gt;
        &lt;/li&gt;
        &lt;li class="MenuHeading" data-menuanchor="Testimonials"&gt;&lt;a href="#Testimonials" onclick="backupNavigation_click(this.href);"&gt;TESTIMONIALS&lt;/a&gt;&lt;/li&gt;
&lt;li class="MenuHeading" data-menuanchor="Specials"&gt;&lt;a href="#Specials" onclick="backupNavigation_click(this.href);"&gt;SPECIALS&lt;/a&gt;&lt;/li&gt;
&lt;li class="MenuHeading" data-menuanchor="AboutUs"&gt;&lt;a href="#AboutUs" onclick="backupNavigation_click(this.href);"&gt;ABOUT US&lt;/a&gt;&lt;/li&gt;
&lt;li class="MenuHeading" data-menuanchor="Quotes"&gt;&lt;a href="#Quotes" onclick="backupNavigation_click(this.href);"&gt;GET A QUOTE&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
                &lt;/nav&gt;
            &lt;/div&gt;


            &lt;div class="content slide"&gt;

                &lt;div id="fullpage"&gt;

                    &lt;div class="section " id="Section0"&gt;
                        &lt;div class="row"&gt;
                            &lt;div class="four columns"&gt;
                                &lt;h4 class="introHeader"&gt;Limousine and party bus services for Chicagoland and the surrounding suburbs.&lt;/h4&gt;

                            &lt;/div&gt;


                        &lt;/div&gt;

&lt;div class="row introAddress"&gt;


                              &lt;p&gt;  2420 Hamilton Road&lt;/p&gt;
&lt;p&gt;Arlington Heights, IL 60005&lt;/p&gt;
&lt;p&gt;773-877-3050&lt;/p&gt;
&lt;p&gt;Email: info@elclimo.com &lt;/p&gt;

&lt;/div&gt;

                    &lt;/div&gt;


                    &lt;div class="section" id="Section1"&gt;



                        &lt;div class="slide" id="Weddings" data-anchor="Weddings"&gt;
      &lt;div class="row"&gt;

                                &lt;div class="nine columns leftPad"&gt;
                                    &lt;h1&gt;Weddings&lt;/h1&gt;
                                    &lt;h4&gt;Making your special day even more special, for everyone.&lt;/h4&gt; Look to Exquisite Limousine Chicago for all the transportation you will need
                                    leading up to and including your wedding day. Why leave anything to chance.
                                    Arrange a special ride for all aspects of your celebration. Engagement party,
                                    bridal shower, bachelor and bachelorette parties, rehearsal dinner and the
                                    wedding day itself. We will make sure that all your guests and participants
                                    are there on time.&lt;/div&gt;


                            &lt;/div&gt;

                            &lt;div class="row"&gt;

                                &lt;div class="three columns leftPad"&gt;
                                    &lt;h5&gt;Bridal Shower&lt;/h5&gt; Having your bridal shower at a great club or restaurant? Rent one of our Party
                                    Buses or stretch limos and make sure everyone is there on time. No more fumbling
                                    with gifts or party favors and finding a parking spot. Pick up and drop off
                                    services are available.&lt;/div&gt;
                                &lt;div class="three columns"&gt;
                                    &lt;h5&gt;Bachelor / Bachelorette Parties&lt;/h5&gt; No one wants to be the responsible one at a bachelor or bachelorette party.
                                   Music and refreshments of your choice are ready and waiting
                                    for you. Our chauffeur can pick you up and drop you off, or you can block his
                                    time out for the night if you plan to hop from place to place. &lt;/div&gt;
                                &lt;div class="three columns"&gt;
                                    &lt;h5&gt;Rehearsal Dinner&lt;/h5&gt;Rent
                                    one of our stretch limos or one of our party buses and get everyone to the
                                    rehearsal dinner at the same time. The introductions and fun start on the ride
                                    over. By the time you arrive at the restaurant, everyone knows each other and
                                    the dinner is off to a great start.&lt;/div&gt;
</code></pre>