1

I want to highlight a div on page load. i could find a solution. But the issue is that it fades out entire content of the div. what i used

$('#searchdiv .highligth').fadeOut(1000);

and the html i have written

                   <div id="searchdiv">
                    <div class="highligth">
                        <table cellspacing="2">
                            <tr>
                                <td>
                                    <a class="anchorText">Filter By:</a>
                                </td>
                                <td>
                                    <asp:ObjectDataSource ID="objLanguage" runat="server" OldValuesParameterFormatString="original_{0}"
                                        SelectMethod="GetLanguage" TypeName="Lang.Repositories.LanguageRepository">
                                    </asp:ObjectDataSource>
                                    <asp:DropDownList ID="dlFilter" runat="server" DataSourceID="objLanguage" DataTextField="LanguageType"
                                        DataValueField="LanguageId" Width="150px" AppendDataBoundItems="True" OnDataBinding="dlFilter_DataBinding"
                                        OnDataBound="dlFilter_DataBound">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:Button ID="btnFilter" runat="server" Width="90px" Text="Filter" OnClick="btnFilter_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>

for few seconds the div is highlighted and as fadeout is mentioned so the content also fade out and the div becomes empty. How to let those control be visible??

Thanks.

Abhishek Ranjan
  • 2,117
  • 4
  • 23
  • 42

4 Answers4

1

Is this what you're looking to do?

 $('.highligth').effect("highlight", {}, 3000);
wanovak
  • 6,079
  • 23
  • 32
  • i tried your code. but i don't see any effect. and i just wanted to hightlight the div for few second but with animation like fadeout. and css for the .highligth{ background-color:White;} – Abhishek Ranjan Jul 15 '11 at 21:14
  • `highlight` changes the background of the DIV to a yellow-ish green and then fades it out according to the `duration`; here 3000 (3 seconds.) – wanovak Jul 15 '11 at 21:16
  • i did see the document but when i wrote your code but it didn't show any effect. so only i wrote that. looks like i need to add the css file – Abhishek Ranjan Jul 15 '11 at 21:26
  • Put the code within `$(document).ready(function(){ ...(hightlight code)... });` – wanovak Jul 15 '11 at 21:29
  • ok i tried your code with fresh page. i am pasting my code which i tried. – Abhishek Ranjan Jul 15 '11 at 21:48
  • Doesnt work.i tried this .
    Hello Worlds
    – Abhishek Ranjan Jul 15 '11 at 21:54
1

Use fadeOut and fadeIn method,

 $('#searchdiv .highligth').fadeOut(1000).fadeIn(2000);

View Demo: http://jsfiddle.net/rgVTW/

Jaykumar Patel
  • 25,525
  • 12
  • 68
  • 75
Pit Digger
  • 9,294
  • 23
  • 74
  • 120
0

Actually there is a very easy and new way to do this.

just add #:~:text=Highlight%20These

try accessing this link

https://stackoverflow.com/questions/38588721#:~:text=Highlight%20a%20text

Jovylle Bermudez
  • 710
  • 5
  • 14
0

Try this

$('#searchdiv .highligth').css({opacity: 0}).animate({opacity: 0.5 }, 1000);
ShankarSangoli
  • 68,720
  • 11
  • 89
  • 123