One-page website featuring a scrolling layout and a stable, constantly updating footer

My goal is to create a single-page, scrolling website that features an array of images with corresponding captions fixed at the bottom of the page. I plan on using unique image IDs to trigger a hide/show event as each image approaches a certain distance from the top of the window. Currently, I have placed each caption within the table containing its respective image. To display the images, I am using tables due to difficulty in responsively centering them both vertically and horizontally on the page, which is a separate issue I am actively working on.

Below you will find the relevant code snippet:

<html>
<body>

    <a id="1">

        <table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%">
        <tr valign="middle"><td align="center" colspan="2">

            <img src="31.jpg" width="40%" style="padding-top:30px; max-width:672px">
    
        </td></tr>
        <tr valign="bottom"><td style="padding:0 0 12 12" height="30">

            Cover for a book of photographs
    
        </td><td align="right" style="padding:0 12 12 0">
 
            <a href="#27" style="padding-right:12px">Up</a><a href="#2">Down</a>
    
        </td></tr>
        </table>
        
    </a>

    <a id="2">

        <table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%">
        <tr valign="middle"><td align="center" colspan="2">

            <img src="22-2.jpg" width="75%" style="padding-top:30px; max-width:1260px">
    
        </td></tr>
        <tr valign="bottom"><td style="padding:0 0 12 12" height="30">

            Title and double-page spread for a book of photographs
    
        </td><td align="right" style="padding:0 12 12 0">
 
            <a href="#1" style="padding-right:12px">Up</a><a href="#3">Down</a>
    
        </td></tr>
        </table>

    </a>

    ...
                        
</body>
</html>

Answer №1

If I were to optimize the layout, I would suggest using divs instead of tables. Create a fixed bottom div with an accessible ID for easy caption text changes. Utilize this javascript code snippet:

if ($('#yourDivThatContainsTheImage').is(':visible'))

To check if the image-containing div is visible. Each image should be placed in its own div with a unique ID for easy caption management. The challenge lies in determining when to change the caption as you scroll through multiple images.

A similar solution can be found here.

Bootstrap offers great tools for responsive design, making it easier to create dynamic pages. Check out this example of integrating Bootstrap with image layouts.

Consider incorporating Angularjs to simplify your markup. Take a look at this example:

<div ng-app='myApp' ng-controller='DemoController'>
  <div infinite-scroll='loadMore()' infinite-scroll-distance='2'>
    <img ng-repeat='image in images' ng-src='http://mysite.it/225x250&text={{image}}'>
  </div>
</div>

Efficiently load images using infinite scroll, ensuring seamless updates as your image list fluctuates.

For optimal results, combine both Bootstrap and Angular frameworks by structuring your code like this:

<div class="container">//bootstrap class
     <div class="row" ng-repeat='image in images'>//angular ng-repeat on the row i.e image in images
            <div class="col-md-10 col-md-offset-1">//container for the image
                  <img ng-src="{{image.source'}}"/>//angular bind to image                
            </div>
      </div>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Develop a Playwright test script that includes fetch requests

My goal is to create an end-to-end test using Playwright for a website built with React. The website functions as follows: Upon initial rendering, it fetches a random fact from one API and then uses the first three words of that fact to fetch a random p ...

Refresh the homepage of a website using React Router by clicking on the site's logo from within the Home component

In most cases, when you click on a website's logo while on the homepage, it typically reloads the page. However, with React, clicking on the logo while already on the Home component does not trigger a reload. Is there a way to work around this issue? ...

Is the maxJsonLength property in the web.config referenced by JQuery's Ajax?

Within my ASP.NET platform, I implement Jquery AJAX to retrieve JSON data (essentially a string) from a webservice upon clicking the search button: $.ajax({ type: "POST", url: url, data: JSON.stringify(parameterArray), contentType: "application/j ...

Possible Chrome Bug Affecting CSS Margin Issue?

Wondering if there might be a bug lurking in Chrome or if my CSS needs some tweaking. The issue at hand is that even though I've set a CSS declaration on .blockmenu li with margin: 2% !important, Chrome doesn't seem to be interpreting the percent ...

Show a translucent overlay iframe containing content fetched from a dynamic URL

I have been attempting to replicate the same functionality as seen on this website: . When you click play or the title of any player, a window appears with an overlay effect. This window contains an iframe. After inspecting the page source, I can determi ...

What is the proper way to execute a datastore query in a Node.js environment?

Attempting to fetch entities from my Google Cloud Datastore, filtered by a specific key name. I can't seem to figure out what I'm doing wrong in my code. First, I initialize my Datastore instance. const ds = new Datastore({ projectId: "my ...

How can you pass arguments between commands in discord.js?

I need to transfer arguments; I have attempted to make them global variables, but I am unsure about the correct approach. Command using the arguments : let messageArray = message.content.split(" "); const args = messageArray.slice(1); const invi ...

Executing jQuery code after a data update in Angular can be achieved by utilizing

Currently, I am working with Angular 1.4.7 on a site that was not set up by me. As a result, I am uncertain about the specific information needed in this scenario. We are displaying search filters, but their enabling or disabling is controlled by data fetc ...

Update the notification header count in Yii2 without the need to reload the page, ensuring that notifications are automatically refreshed every

Whenever I send a notification from my frontend to backend, I find myself having to reload the page to receive any new notifications. Additionally, every time I read a notification, the count disappears until I reload the page again. How can I change the s ...

Is it possible to send the result to the browser without using result.send?

Although I can successfully query a MS-SQL server, I'm having trouble displaying the result in the browser. var express = require('express'); const sql = require("mssql/msnodesqlv8"); var app = express(); const main = async() => { ...

Press the key to trigger the event

Developing a POS solution has been a challenging process for me, especially when it comes to opening the Till Drawer. Currently, I am attempting to accomplish this by using a combination of keys, such as CTRL+SHIFT+p. My goal is to execute these keys when ...

Unable to perform multi-delete action upon clicking the checkbox button as intended

Within my GridView, I have implemented a Multi-delete feature. Below is the code snippet for your reference:- <script type="text/javascript> function ValidateAll() { var chkselectcount = 0; var gridview = document.getElementById( ...

"The functionality of the RequireJS module shim is not functioning as expected during testing with Jasmine

In my JavaEE project, I am using RequireJS to load several third-party frameworks. One of these frameworks is OpenLayers3, which creates a global variable called "ol." Although OpenLayers3 is AMD compatible, a plugin I am using called "olLayerSwitcher" dep ...

Is there a way to modify my function expression without using any state variables?

Currently working on a jQuery game where the player is generated upon clicking a button. Below is the function expression I'm using to store the player's information: var getPlayerData = function() { return { name: $("#name").val(),/ ...

The sup tag does not function properly when used within the title tag

I added a sup tag inside a title tag but it doesn't seem to work. Surprisingly, the same sup tag works perfectly fine within li tags. Can anyone explain why this is happening? I tried changing the title tags to H class tags but I'm still curious ...

Is there a way to restrict input to numeric characters exclusively in Swal Sweetalert?

I'm wondering how I can restrict input to only numeric values in this section. { title: "Dollar Amount?", text: "How much is your Dollar Question worth?", inputPlaceholder: "Enter Amount" } I'm currently utilizing a Sweetalert p ...

Bootstrap columns stacking in a disorganized manner

I'm struggling to correctly stack my columns using bootstrap. The image shows that I need the black box to be positioned below the green box, but I can't seem to get it right: https://i.sstatic.net/7bvN6.png This is the code I have been using: ...

"Troubleshooting callback errors and viewing statistics in multi-configuration setups

Is it possible to utilize multiple Webpack configs while in watch mode? I have noticed that the compilation callback behaves differently when using build versus watch. I couldn't find any references to this behavior and was curious if anyone else has ...

What are the steps to resolving an issue with importing a css file in next.js?

Error: ./node_modules/quill-emoji/dist/quill-emoji.css ModuleParseError: Module parse failed: Unexpected character '�' (1:0) You may need a suitable loader for handling this file type, as there are currently no configured loaders to process it. ...

Using ng-repeat in conjunction with jQuery and Rails

When working with ng-repeat to loop through JSON objects, I encountered a challenge trying to add {{code.id}} as a parameter for a Rails route. For example: card_url( @car, {{card.id}} ) I understand that this is not possible because Rails renders the ro ...