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

  • Home
  • SEARCH
  • 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 9003107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:40:16+00:00 2026-06-16T00:40:16+00:00

I have a page where my content, which are images, scrolls down and has

  • 0

I have a page where my content, which are images, scrolls down and has a fixed title on the side. I require the title on the side which is a fixed div, to change as the images roll up, to describe each image.

Please see http://kimcolemanprojects.com/artworks.html

thanks for any advice on how to achieve this.

angela

  • 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-06-16T00:40:17+00:00Added an answer on June 16, 2026 at 12:40 am

    I’ve written some weeks ago a simple jQuery expression, so here’s a simple solution that fits to your requirements…

    jQuery expression

    jQuery.expr.filters.inView = function(el) {
        var width = $(el).width(),
            height = $(el).height(),
            offset = $(el).offset(),
    
            vp_dimensions = {
                height: $(window).height(),
                width: $(window).width()
            },
            y_offset = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop),
            x_offset = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
    
        return (
        offset.top < (y_offset + vp_dimensions.height) && offset.left < (x_offset + vp_dimensions.width) && (offset.top + height) > y_offset && (offset.left + width) > x_offset);
    };
    

    Scroll Event

    $(window).scroll(function() {
    
        $('li').each(function() {
            var self = $(this),
                title = self.prev('.title').text();
            if (self.is(':inView')) {
                $('#title').find('h2').text(title);
            }
        });
    
    }).scroll();
    

    Fiddle

    Update

    To do it a bit nicer I’ve removed your placeholder .title‘s and added its contents to your img-alt attributes:

    $(window).scroll(function() {
    
        $('li').each(function() {
            var self = $(this),
                title = self.find('img').attr('alt');
            if (self.is(':inView')) {
                $('#title').find('h2').text(title);
            }
        });
    
    }).scroll();
    

    And your new HTML:

    <div id="header">
        <div id="title">
            <h2>Untitled 1</h2>
        </div>
    </div>
    <div id="main" class="main">
        <ul>
            <li id="1">
                <a onClick="goToByScroll('2')" href="javascript:void(0)"><img src="Untitled17.jpg" alt="Unititled 1"></a>
            </li>
            <li id="2">
                <a onClick="goToByScroll('3')" href="javascript:void(0)"><img src="Untitled9.jpg" alt="Unititled 2"></a>
            </li>
            <li id="3">
                <a onClick="goToByScroll('4')" href="javascript:void(0)"><img src="Frame2.jpg" alt="Unititled 3"></a>
            </li>
            <li id="4">
                <a onClick="goToByScroll('1')" href="javascript:void(0)"><img src="Untitled2.jpg" alt="Unititled 4"></a>
            </li>
        </ul>
    </div>
    

    Fiddle

    UPDATE

    I’ve rebuild your link anchors and removed the "inline-onclick"-events:

    Complete Site – Fiddle

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

Sidebar

Related Questions

I have the below xpath expression //div[@class=post-content]//img which runs on a html page, scanning
I have the following jQuery code: $(body.page-calendar-practices-2012-05 #content-header h1#title) which works fine. I can
I have a page (main.php) which loads content from an external PHP file (rpc.php).
I have a web page in which a fair amount of the content is
I have a textarea within an HTML page into which my users paste content.
I have a menu at the top of the page which is fixed in
I have a site which uses largeish (60-100k) background images which vary from page
I have a master page with one div Header. #header { background-image: url(images/ST_ERP_2.jpg); background-repeat:
I have a _layout page which has a login box (partial view) and that
I have a div with a lot of content in it which crosses the

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.