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 8896739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:09:18+00:00 2026-06-15T00:09:18+00:00

i saw a stack question posted already: [question]: < Text in div – automated

  • 0

i saw a stack question posted already:

[question]: < Text in div – automated scrolling with jQuery – jsFiddle inside >

My question adding to this is, is it possible to have the text in each paragraph or separated divs highlighted (boldness, background color, etc.) once they are in main view, whilst the p’s or div’s leaving/entering the slider box are faded?

So like the jsfiddle referenced, you have a div container with say 4,5,6,… div’s or p’s inside of it and one div or p is visible whilst the div or p above and below it, only half would be visible (faded), whilst the remaining overflow is hidden.

thanks.

  • 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-15T00:09:19+00:00Added an answer on June 15, 2026 at 12:09 am

    If I understand you correctly, you’re looking for an effect like this:

    http://jsfiddle.net/2RRWS/

    My code assumes an html structure like:

    <div id="scrollContainer">
       <p>Some text</p>
       <p>More text</p>
       ...
    </div>
    

    And some CSS to set the width/height of the containing div as appropriate. Also it assumes some classes for “dimmed” and “highlighted” paragraphs.

    There’s probably a cleaner way to do this, but this is just what I cobbled together and it seems to work, so…

    var $container = $("#scrollContainer"),
        $ps = $container.find("p"),
        containerHeight = $container.height(),
        contentHeight = 0,
        scrollTop = 0;
    
    // figure out the height of the content
    $ps.each(function() {
        contentHeight += $(this).outerHeight();
    });
    
    // add some blank space at the beginning and end of the content so that it can
    // scroll in from the bottom
    $("<div></div>").css("height", 400).appendTo($container).clone().prependTo($container);
    
    setInterval(function() {
        if (paused)
            return;
        // if we've gone off the end start again
        if (scrollTop > contentHeight + containerHeight)
            scrollTop = 0;
        // scroll up slightly
        $container.scrollTop(scrollTop++);
    
        $ps.removeClass("highlighted")   // for each paragraph...
           .addClass("dimmed")           // dim it
           .each(function() {            // unless it is in view
               var $this = $(this),
                   top = $this.position().top,
                   height = $this.height();
               if (top > 0 && top + height < containerHeight)
                        $(this).addClass("highlighted").removeClass("dimmed");
        });
    }, 20);
    
    $container.hover(function() {
        paused = true;
    }, function() {
        paused = false;
    });
    

    EDIT: Updated to implement “pause” feature as per comment. http://jsfiddle.net/2RRWS/8/

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

Sidebar

Related Questions

I just saw this mentioned in Stack Overflow question Best WYSIWYG CSS editor and
I saw this Stack Overflow Question but I cannot find the answer to the
I saw some threads on this already on Stack, but wanted a little more
I saw this quote in this question : MS support is poor, except when
Possible Duplicate: Overloading assignment operator in C# I remember I saw this question somewhere
I was asked this question while interviewing for a startup and saw this again
I saw this script in another thread on stack overflow and tried to play
So I saw this question: How do you connect the "delegate" outlet of a
I saw a lot of things on stack overflor to get the highest div,
I think this question is technical enough for Stack Overflow and, probably, too programming-oriented

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.