wow
wow

Reputation: 8239

How to highlight div using javascript or jquery

I spent about hour and did not find any clue how to highlight my div.

Ok example my code.

1.proccess.php

$_SESSION['msg']='<div class="success">Your account has been updated</div>';
header("location:http://domain.com/account.php/");

2.account.php

if ($_SESSION['msg']!="") {
echo $_SESSION['msg'];
unset($_SESSION['msg']);
}

Now I want the javascript or jquery to highlight the <div class="success"> on account.php. How to do that? Let me know :)

Upvotes: 1

Views: 4166

Answers (2)

karim79
karim79

Reputation: 342635

jQuery UI has a highlight effect:

$(document).ready(function() {
    $('div.success').effect("highlight", {}, 3000);
});

The above code will need to be loaded into the page containing your div, along with jQuery, jQuery ui.core.js and effects.highlight.js

Upvotes: 1

hurikhan77
hurikhan77

Reputation: 5931

You probably were looking for this:

http://docs.jquery.com/UI/Effects/Highlight

That's the highlight effect which "focusses" your attention. So "focus" was just the wrong search term to go for?

Upvotes: 1

Related Questions