astralaaron Posted February 16, 2008 Share Posted February 16, 2008 is there anything wrong with this picture? why isnt it working? <html><head><link rel="stylesheet" style="text/css" href="hide.css"/></head><script type="text/javascript" />function openx() {v = document.getElementById('one');v.style.visibility = 'visible';}</script><body><div id="one" onmouseover="openx()" ><p>testing.</p></div></body></html> #one div{ position: absolute; visibility: hidden; margin: 60; padding: 20; width: 200px; height: 100px; background: #EAEBD8; border: 1px solid #5970B2} Link to comment Share on other sites More sharing options...
jhecht Posted February 16, 2008 Share Posted February 16, 2008 So basically what you're trying to do is that when the user mouses over the thing, it shows the thing, right? First, might i say, bit weird. kinda silly. How am i, the user, supposed to know im hovering over something? Also, why not just make a simplier function: function open(item){ if(item==null || item==undefined){ return; } item = (item.constructor=='string') ? document.getElementById(item) : item; if(item.style.visibilty=='hidden'){ item.style.visibility=''; }else{ item.style.visibility='hidden'; }}...<div id="thing" onmouseover="open(this)"> Hi you</div> Link to comment Share on other sites More sharing options...
astralaaron Posted February 16, 2008 Author Share Posted February 16, 2008 im just messing around with the language trying to understand how i can manipulate things....EDIT** by the way.. will you break that down for me? it is a little confusing Link to comment Share on other sites More sharing options...
astralaaron Posted February 16, 2008 Author Share Posted February 16, 2008 <html><head><link rel="stylesheet" style="text/css" href="hide.css"/></head><body><script type="text/javascript" />function open(item){ if(item==null || item==undefined){ return; } item = (item.constructor=='string') ? document.getElementById(item) : item; if(item.style.visibilty=='hidden'){ item.style.visibility=''; }else{ item.style.visibility='hidden'; }}</script><div id="thing" onmouseover="open(this)">Hi you</div></body></html> i tried this... when the document loads i can see "hi you" in the corner.. when i mouse over 'hi you' = disapears Link to comment Share on other sites More sharing options...
Synook Posted February 17, 2008 Share Posted February 17, 2008 <html><head><link rel="stylesheet" style="text/css" href="hide.css"/></head><body><script type="text/javascript" />function open(item, visible){if(item==null || item==undefined){return;}item = (item.constructor=='string') ? document.getElementById(item) : item;if(visible){item.style.visibility='';}else{item.style.visibility='hidden';}}</script><div id="thing" onmouseover="open(this, true)">Hi you</div> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.