Question

I wonder how to make a div glow in a specific color when the page has loaded.

<div id="glow" class="logo registrer"><a href="http://henricson.net/registrer.php" class="understrek">Registrer deg</a></div>

This is the div i want to glow. Thank you :)

Was it helpful?

Solution

CSS3 can do that:

-webkit-box-shadow:0 0 20px blue; 
-moz-box-shadow: 0 0 20px blue;
box-shadow:0 0 20px blue;

Here's a JSFiddle that shows that it does, in fact, it works fine with me, check it out to see :)

OTHER TIPS

I'm not sure how you mean to glow? If to simply change colour then you can do something like the below.

$(document).ready(function(){
   $('#glow').animate({backgroundColor:'green'});
});

You could then add some box-shadow to add a glow effect.

-webkit-box-shadow: 0px 0px 5px 5px rgba(0, 150, 0, 0.3);
box-shadow: 0px 0px 5px 5px rgba(0, 150, 0, 0.3);

Please see this example fiddle of an animating background colour and shadow added.

EDIT

Sorry I forgot to mention you'll need to include the color animation plugin to be able to do this.

Also here is another fiddle that runs after half a second and then removes the glow.... obviously this would need alot of tweaking to make it look nice.

<div class="col-md-6 col-md-offset-3" id="notificationmain">
  <div class="sub"><blockquote id="notification" class="alert alert-success" glowing="0">User Has been created</blockquote></div>  

    <script>
        $(document).ready(function() {
            setTimeout(function () { $('.sub blockquote').glow('#FFFFDD', 800); }, 100);
        });
    </script>
</div>

You need to reference

<script src="~/Scripts/jquery.glow.js"></script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top