I have a webpage on which there is a link . When the user clicks on that link it popup a window. The window popup functionality depends on the name of the url.
I don't want to show the link for some webpage but not able to hide the link on page load. I used this code =
document.getElementById('size').style.visibility='hidden';
but the problem with this code is when user clicks on the link it hides itself but if the user not clicks on the link it remains visible.
The code for window popup is-
<script type="text/javascript">
//<![CDATA[
function call(id){
var link = window.location.href ;
var e = document.getElementById(id);
var jockey = link.match("jockey");
var vest = link.match("vest");
var shorts = link.match("shorts");
if((jockey =="jockey") && (vest =="vest")){
document.getElementById('size').style.visibility='hidden';
}
else if((jockey =="jockey") && (shorts =="shorts")){
littleWindow = window.open("http://niraame.com/media/wysiwyg/jockeyBoxerFP05.jpg", " " ,"location=center,width=520,height=520 ,toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left ");
}
//]]>
</script>
Code to display the button-
<div id="size">
<p><strong><a href="javascript:call()">Size Chart</a></strong></p>
</div>
style.display = noneinstead of usingvisibilityand see if that helps.