tags:

views:

64

answers:

4

EDIT:

its a confirmation div box that when the user click on save button, you typicall see the confirming that they have receivied your inqury.

and the div box look like this:

"[image] We got your email, and you should hear from us within 24 hours."

below is the code that i am using to display div with image but whats happening that, when the page loads i see the image first and than after i save the image i see the div msg and than image and div disappears (as it suppose to)

<div id="divStatus"></div> 

<style type="text/css"> 
#divStatus {
    background:transparent url(../images/ico_confirmation_sml.gif) no-repeat scroll 0 0;
    padding-left: 22px;
    min-height: 27px;
} 


ScriptManager.RegisterClientScriptBlock(this, this.GetType(), key, "$(function() { $('#divStatus').html('" + msg + "').show().fadeIn(800).fadeOut(9000); });", true);
+1  A: 

If I understand your question correctly, that the image shows until you click save, it looks like you need to hide the image in your css.

Try adding opacity: 0 to the divStatus ID

 
#divStatus {
    background:transparent url(../images/ico_confirmation_sml.gif) no-repeat scroll 0 0;
    padding-left: 22px;
    min-height: 27px;
    opacity: 0;
} 

graham
does not work, when the page loads i se the image but what i want that only the image and div shows when i click on save.
Abu Hamzah
try adding display: none
graham
A: 

I have updated your code a bit, check demo

http://jsfiddle.net/69f6H/2/

#divStatus {
    background:url("http://www.lancs.ac.uk/~lubbs/images/home.gif") no-repeat;
    padding-left: 22px;
    min-height: 27px;
    display:none;

}​

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), key,
"$(function() { $('#divStatus').html('" + msg + "').fadeIn(800).fadeOut(9000); });",
true);
JapanPro
A: 

You may need to set your css to display: none; as others have stated or add abit of javascript.

<script type="text/javascript">


function showImage()
{
     getElementById('divStatus').style.display="block";
}

</script>

Then on the button add : onclick="showImage();"

Elliott
A: 

Try using the display:none function before the use of fading it in. This will hide it before the use, to clarify that you want it fading in.

hart1994