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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:13:45+00:00 2026-06-05T23:13:45+00:00

Without using any other jquery plugin I’m looking to continuously flash/change a div’s border

  • 0

Without using any other jquery plugin I’m looking to continuously flash/change a div’s border color.
So it should start with white then after 1 sec change to orange, then repeat.

  • 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-05T23:13:46+00:00Added an answer on June 5, 2026 at 11:13 pm

    Css:

    #my-div { border: 1px solid white; }
    #my-div.orange-border { border: 1px solid #f93; }
    

    Html:

    <div id="my-div"></div>
    

    JavaScript:

    var flashInterval = setInterval(function() {
        $('#my-div').toggleClass('orange-border');
    }, 1000);
    

    To stop flashing:

    window.clearInterval(flashInterval);
    

    Solution without flash:

    $('#my-div').css({ border: '1px solid white' });
    
    setInterval(function() {
        var isWhite = $('#my-div').css('border-color') == 'rgb(255, 255, 255)';
        $('#my-div').css({ 'border-color' : isWhite ? '#f93' : '#fff' });
    }, 1000);​
    

    It looks a bit hackish with the rgb comparison. It might be neater to have a flag that you toggle back and forth, perhaps a data property:

    $('#my-div').css({ border: '1px solid white' }).data('white', true);
    
    setInterval(function() {
        var isWhite = $('#my-div').data('white');
        $('#my-div').css({ 'border-color' : isWhite ? '#f93' : '#fff' }).data('white', !isWhite);
    }, 100);​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to check visited link using jquery without using any plugin please help to
I have been trying to create rotating object using jQuery and without any other
Without using any jQuery or other libraries, I'm trying to send a simple POST
How do I determine, without using jQuery or any other JavaScript library, if a
How do I add two numbers without using ++ or + or any other
I need to calculate hours using Server time in php without any other or
Is it possible using jQuery, or any other language, to make an input's value
I'm using the jQuery.Validation plugin for client side validation, and among other things I
I am simply looking for a way of using drag and drop without jquery
How can we separate Logic from presentation without using any template engine (traditional php-not

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.