Skip to content Skip to sidebar Skip to footer

Javascript Show/hide Will Not Hide Properly In Safari

It seems to be a problem with show/hide in Safari. The site looks good freshly loaded. But if you click on the first link up in the left corner and than go back, the show/hide func

Solution 1:

I would suggest you use jquery to show/hide the elements.

functionshow(id){
    $('.student').hide(); // hide all students
    $('#'+id).show(); // show the student with applied ID
}

functionhide(id){
    $('#'+id).hide(); // is this needed? Why not do the next one and skip the parameter to the function?
    $('.student').hide();
}

Solution 2:

try this and note the difference in .style.display

<scripttype="text/javascript">functionshow(id) {
    document.getElementById(id).style.display= "";
  }
  functionhide(id) {
    document.getElementById(id).style.display= "none";
  }
 </script>

Post a Comment for "Javascript Show/hide Will Not Hide Properly In Safari"