PDA

View Full Version : hiding webpage?



stevedc
10-23-2008, 12:39 AM
Hi all,

I came across a site a few days ago that had an interesting piece of functionality. When you click on the "eye" icon on the top right of the screen, the webpage disappears and only the fullscreen background image is shown. I'm wondering if anyone has any resources on how to do this. I'm working on a project right now where this would be very useful.

http://itp.nyu.edu/sigs/

~ Regards
Steve

TheJoshMan
10-23-2008, 12:44 AM
well, you could use some sort of "onclick" event with javascript which would activate a stylesheet that had everything set to "visibility:hidden;"

you would need to locate all of your "container" elements and make sure they all have either ID's or Classes in css... then in a separate stylesheet set them all to "visibility:hidden;"

stevedc
10-23-2008, 12:47 AM
sounds like a good idea. I need to brush on my javascript a bit.

Thanks Nyne

TheJoshMan
10-23-2008, 12:51 AM
glad to help

Medyman
10-23-2008, 12:57 AM
you would need to locate all of your "container" elements and make sure they all have either ID's or Classes in css... then in a separate stylesheet set them all to "visibility:hidden;"

Ideally, it would only be one element and you can don't need to go about changing the stylesheet. That would work, but it's a harder solution in my view. If you're hiding disjointed portions, then a stylesheet switch would be smarter.

I use jquery for this kind of thing. But, I've also used this small snippet in the past:


<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
//-->
</script>


On a unrelated note...that website brings back a lot of memories. I did my undergraduate studies at NYU. Quite the days...

stevedc
10-23-2008, 01:50 AM
thanks medyman and nyne for your help! I managed to find something that worked well. I have yet to decide on what the button will look like, but the dark grey square works for now until I actually have the design actually finished, approved and ready for build out.

http://spectrum-ltd.com/comps/index_2.html

I love this forum, yet I am still a junior coder....:(

~ Regards
Steve