dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Javascript content load, screenview to resolve at top of the page

  1. #1
    Join Date
    Aug 2012
    Posts
    2

    Javascript content load, screenview to resolve at top of the page

    Hi,

    I'm looking for help customizing some JavaScript. I'm primarily a web designer and I recently added some JavaScript to my portfolio website.

    http://www.revelae.com/spotlight.html

    When you click on the "more" thumbnail images at the bottom of the page, the page loads in additional content.
    Everything works great, but I want the content to "load" while bringing the screenview back up to the top of the page after each thumbnail click.

    I think this is a pretty quick fix, I just need to add something extra to my current JavaScript code. Any help on what to add is greatly appreciated!

    Here's the code:
    <script type="text/javascript">
    ajax.pages = new Array();
    ajax.pages["spotlight-main"] = "spotlight-main.html";
    ajax.pages["spotlight-royal-rompers"] = "spotlight-royal-rompers.html";
    ajax.pages["spotlight-trievas-spa"] = "spotlight-trievas-spa.html";
    ajax.checkHash = function()
    {
    var windowHash = window.location.hash.replace("#", "");
    windowHash = (windowHash == "") ? "spotlight-main" : windowHash;
    if(windowHash != ajax.currentHash)
    {
    ajax.setHash(windowHash);
    }
    }
    </script>

    I'm also using a swap.js script.

    -Katie

  2. #2
    Join Date
    Aug 2012
    Posts
    2
    Never mind! Fixed with help from a different forum!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles