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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:18:23+00:00 2026-05-26T00:18:23+00:00

On StackOverflow website, you will notice your ‘Notifications’ indicator at the top left. When

  • 0

On StackOverflow website, you will notice your ‘Notifications’ indicator at the top left. When somebody replies to your question/answer, you click the notification and it directs you to that particular reply, then displays with an orange background and slowly fades to white, to let you know which reply you’re looking at. I would like to know how I can achieve this fade method.

The element I would like to flash is a div. Below is how my DIVS are arranged as they are dynamically produced by ASP:

...
<div id="1046" class="photoBlob">........</div>
<div id="1047" class="photoBlob">........</div>
<div id="1048" class="photoBlob">........</div>
...

As you can see, it already contains styles (class=”photoBlob”), the background is transparent until mouse-over, when it changes to grey.

The particular DIV I need to flash comes from a query string (photos.asp?photoID=1047). What I mean by flash, is to change the background of the DIV to color (#19426E) and then fade that color back to transparent after 2 seconds.

I could probably work it out if there was one DIV to flash and that I knew the DIV ID to flash, but coming from a query string, I have no idea what I am doing. I would be grateful for any suggestions, examples or snippets to get me started with this. I think I found JQuery plugins for flashing elements but even then, how do I feed that plugin with my query string ‘photoID’, my JS is rubbish obviously!

Many thanks

MY ANSWER – Thanks to (150PoundsOfDonamite)

I actually made a mistake, my div’s id was NOT coming from a query string, it was coming from the anchor/hash part of the URL. So thanks to the accepted answer (below), I managed to get this working – and looks the biz!

I added the JQuery plugin: http://www.bitstorm.org/jquery/color-animation/

I then added this JQuery/Javascript:

$(document).ready(function() {
    var flashDiv = window.location.hash;

    if(flashDiv!==false) {
        setTimeout(function() {
            $(flashDiv).animate({backgroundColor: '#19426E'}, 2000);
            $(flashDiv).animate({backgroundColor: 'rgba(0,0,0,0)'}, 2000);
        }, 1000);
    }
});
  • 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-05-26T00:18:23+00:00Added an answer on May 26, 2026 at 12:18 am

    You can do that using this Jquery color animation plugin. Of course, that is assuming that you are using Jquery. If your javascript skills are not as strong as you’d like, jQuery is a good place to start. Don’t get me wrong, it’s no replacement for learning pure javascript, but it does a lot of things for you.

    The color animation based on John Resig’s color animation plugin, but adds rgba support so you can have your transparency. You can also animate text and border colors.

    In order to get the photo id from the query string, you can use a function like this (which I found in SO here), but I personally find a def (default) argument helpful when I want to set the return value automatically when name is not found in the query string:

    function getParameterByName(name, def) {
        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
        var regexS = "[\\?&]" + name + "=([^&#]*)",
            regex = new RegExp(regexS),
            results = regex.exec(window.location.href);
    
        if(results == null)
            return def;
        else
            return decodeURIComponent(results[1].replace(/\+/g, " "));
    }
    

    Put that just about anywhere in a script tag. Then to get your parameter and flash it, place it where you need it (eg., head tag). Here I’m assuming you want to do this at documentReady (when the page’s DOM elements are loaded), but you could also delay it a bit, or wait til hover or some other event.:

    $(document).ready(function() {
        var flashDiv = getParameterByName("photoID", false);
    
        if(flashDiv!==false) {
            $("#"+flashDiv).animate({backgroundColor: '#19426E'}, 2000);
            $("#"+flashDiv).animate({backgroundColor: 'rgba(0,0,0,0)'}, 2000);
        }
    });
    

    If you’d like to delay that 2 seconds after the page has loaded:

    $(document).ready(function() {
        var flashDiv = getParameterByName("photoID", false);
    
        if(flashDiv!==false) {
            setTimeout(function() {
                $("#"+flashDiv).animate({backgroundColor: '#19426E'}, 2000);
                $("#"+flashDiv).animate({backgroundColor: 'rgba(0,0,0,0)'}, 2000);
            }, 2000);
        }
    });
    

    And if you’d like to wait until the user mouses over that (but only once):

    $(document).ready(function() {
        var flashDiv = getParameterByName("photoID", false);
    
        if(flashDiv!==false && !flashed) {
            $("#"+flashDiv).one("mouseover", function() {
                $(this).animate({backgroundColor: '#19426E'}, 2000);
                $(this).animate({backgroundColor: 'rgba(0,0,0,0)'}, 2000);
            });
        }
    });
    

    Update after comment:

    Getting your photoId after the # is even easier (you won’t be needing the getParameterByName function, of course):

    $(document).ready(function() {
        var photoId = document.location.href.split("#")[1];
    
        if(photoId!==undefined) {
            $("#"+photoId).animate({backgroundColor: '#19426E'}, 2000);
            $("#"+photoId).animate({backgroundColor: 'rgba(0,0,0,0)'}, 2000);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If we look at the stackoverflow website we have votes. But the question is
This question is an continuation on another StackOverflow post where no clear answer is
I'm considering developing a website similar to stackoverflow, but the answers may also consist
How to implement a website with a recommendation system similar to stackoverflow/digg/reddit? I.e., users
There has been some talk of Website performance monitoring tools and services on stackoverflow,
I am implementing a tagging system on my website similar to one stackoverflow uses,
Stackoverflow User Luke wrote in this answer : The boundaries between desktop and web
First, thanks for the StackOverflow team, cause it's a very useful website, since i'm
First question on stackoverflow. I have no previous experience of running a high traffic
I have virtually the same question as https://stackoverflow.com/questions/3300504/finding-out-all-websites-hosted-by-a-webhosting-service ... I'm trying to get shared

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.