Click here to Skip to main content
15,885,936 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hai,


am using html img for saving and updation data,i want to check some data based on image is visible in onscreen,In my form saving time the update button is hidden,pls help me
Posted

Try this :


JavaScript
function check() {

if($("#img").css("visibiliy") != "hidden" && $("#img").css("display") != "none") {
     alert("image is visible");
} else {
     alert("image is hidden");
}

}

<img id="img" src="image.png" />
 
Share this answer
 
Image markup is given by
HTML
<img src="source.jpg" id="myImg" style="height:200px;width:150px" />


Script to add validation for particular image element goes as below.

JavaScript
$(document).ready(function(){
    if($("#myImg").css("display")!="none" && $("#myImg").css("visibility") !="hidden")
    {
        alert("Do stuff that are done after load of image");
    }
    else
    {
        alert("Do stuff those should be done before rendering of image");
    }
});
 
Share this answer
 
v2
Comments
athira Paramesh 21-Aug-13 7:22am    
Thanku
Jitendra Sabat 21-Aug-13 7:25am    
Welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900