<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://www.netlobo.com/commentsrss.php?aid=66" rel="self" type="application/rss+xml" />
		<title>Comments on: Showing/Hiding a DIV using the Off-Left Method</title>
		<description>A Javascript function for hiding a DIV by moving it off the left of the browser window</description>
		<link>http://www.netlobo.com/comments/off_left_div_hiding</link>
		<language>en-us</language>
		<copyright>Copyright 2010, Netlobo.com</copyright>
		<lastBuildDate>Thu, 20 Nov 2008 18:26:26 GMT</lastBuildDate>
		<generator>Netlobo In-house RSS v1.4</generator>
		<item>
			<title>tracy</title>
			<description>hi...this is very simple and exactly what i was looking for. thank you so much for posting it.&lt;br /&gt;
&lt;br /&gt;
quick question: ...i'm trying to use the body.onload code to have everything hidden when the page loads...and i've read your WOM doc and implemented that ...but still not sure how or where to add the body.onload code?&lt;br /&gt;
&lt;br /&gt;
please...some hints?&lt;br /&gt;
&lt;br /&gt;
thanks</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-360</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-360</guid>
			<pubDate>Thu, 20 Nov 2008 18:25:16 GMT</pubDate>
		</item>
		<item>
			<title>lobo235</title>
			<description>egordin,&lt;br /&gt;
&lt;br /&gt;
1) It is possible with the other method. You would basically have to do the same thing, break the function up into two parts and add the logic to update the link text.&lt;br /&gt;
&lt;br /&gt;
2) There are ways to do smooth transitions but I have not done much with those so you're better of looking somewhere else with that.&lt;br /&gt;
&lt;br /&gt;
3) They should work in Google Reader just fine but sometimes it takes a while for Google to realize that the feed has been updated. I believe Google Reader only fetches feeds every couple of hours unless it's a site that is updated frequently.</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-298</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-298</guid>
			<pubDate>Thu, 24 Jul 2008 16:12:48 GMT</pubDate>
		</item>
		<item>
			<title>egordin</title>
			<description>Lobo235,&lt;br /&gt;
&lt;br /&gt;
Thank you so much! I am coding an iPhone interface and this is really helpful. &lt;br /&gt;
&lt;br /&gt;
Three questions:&lt;br /&gt;
&lt;br /&gt;
1) Is this same indicator thing possible with your other method (http://www.netlobo.com/div_hiding.html) too?&lt;br /&gt;
&lt;br /&gt;
2) If it is possible with the other method, is there any way to slow down the transition so that it goes slightly more smoothly?&lt;br /&gt;
&lt;br /&gt;
3) Not really a question but the RSS links for subscribing to these comments don't seem to work with Google Reader. Just thought you should know. &lt;br /&gt;
&lt;br /&gt;
Thanks again for your help. It's immensely useful not only for me but for a lot of people! Keep up the great work!&lt;br /&gt;
&lt;br /&gt;
</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-297</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-297</guid>
			<pubDate>Thu, 24 Jul 2008 16:00:34 GMT</pubDate>
		</item>
		<item>
			<title>lobo235</title>
			<description>egordin,&lt;br /&gt;
&lt;br /&gt;
Yes, you can have the link text change when the div is hidden or shown. In order to do this you will need to break the toggleDivOL function into two separate functions and add some code to each function to update the link text. I have created an example page that does just that. Please take a look at &lt;a href=&quot;/media/examples/off-left-div-link.html&quot;&gt;this example page&lt;/a&gt; where you can view the source and see how it could be done.</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-296</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-296</guid>
			<pubDate>Thu, 24 Jul 2008 15:06:06 GMT</pubDate>
		</item>
		<item>
			<title>egordin</title>
			<description>Great Tutorial! Just one question - is it possible to have the link change depending on the state of the div? &lt;br /&gt;
&lt;br /&gt;
What I mean is, can the link text change to HIDE when the div is showing and SHOW when the div is hidden?&lt;br /&gt;
&lt;br /&gt;
Thanks again!</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-293</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-293</guid>
			<pubDate>Thu, 24 Jul 2008 08:21:10 GMT</pubDate>
		</item>
		<item>
			<title>djoaniel</title>
			<description>very excellent use of css positioning. its probably the simpliest show hide i've seen byfar.&lt;br /&gt;
&lt;br /&gt;
no more element id fetching.</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-106</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-106</guid>
			<pubDate>Mon, 29 Oct 2007 13:58:52 GMT</pubDate>
		</item>
		<item>
			<title>Sam</title>
			<description>Found a solution that is a good cross browser implementation. Thought I would share it just in case someone else needs it :&lt;br /&gt;
&lt;br /&gt;
/*************************************************************/&lt;br /&gt;
/* Catch onbody clicks to initiate certain actions - Sam Allen Aug 07 */&lt;br /&gt;
document.onclick = loadEventListener; // Capture every click to fire LoadEventListener  &lt;br /&gt;
var clickedElement = &amp;quot;MenusClosed&amp;quot;; // set variable to contol shutting menus&lt;br /&gt;
&lt;br /&gt;
function loadEventListener() {&lt;br /&gt;
document.getElementById(&amp;quot;defaultlocation&amp;quot;).onclick = function() { clickedElement = 'defaultlocationMenuClicked';window.setTimeout(&amp;quot;clickedElement = 'noMenuClicked'&amp;quot;,100);} // If defaultlocation div is clicked set variable and timer new value for closing menus&lt;br /&gt;
document.getElementById(&amp;quot;defaultlocationLink&amp;quot;).onclick = function() { clickedElement = 'defaultlocationMenuClicked';window.setTimeout(&amp;quot;clickedElement = 'noMenuClicked'&amp;quot;,100);} // If defaultlocationLink is clicked set variable and timer new value for closing menus&lt;br /&gt;
document.getElementById(&amp;quot;locmenu_wrapper&amp;quot;).onclick = function() { clickedElement = 'locmenu_wrapperMenuClicked';window.setTimeout(&amp;quot;clickedElement = 'noMenuClicked'&amp;quot;,100);} // If location_menu div is clicked set variable and timer new value for closing menus&lt;br /&gt;
if (clickedElement == &amp;quot;defaultlocationMenuClicked&amp;quot;) { // if defaultlocationMenuClicked&lt;br /&gt;
		hideDiv('locmenu_wrapper'); // hide this menu div&lt;br /&gt;
	}&lt;br /&gt;
else if (clickedElement == &amp;quot;noMenuClicked&amp;quot;){ // on mouseclick, if no menu is clicked&lt;br /&gt;
	hideDiv('locmenu_wrapper'); // hide this menu div&lt;br /&gt;
	hideDiv('defaultlocation'); // hide this menu div&lt;br /&gt;
	clickedElement = &amp;quot;MenusClosed&amp;quot;; // change status to MenusClosed waiting for menu to open&lt;br /&gt;
}&lt;br /&gt;
}</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-71</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-71</guid>
			<pubDate>Tue, 04 Sep 2007 22:43:38 GMT</pubDate>
		</item>
		<item>
			<title>lobo235</title>
			<description>It looks like your code is headed in the right direction but I am not aware of any cross-browser scripts that would accomplish what you need to do. You may want to try asking your question in a webmaster forum such as http://forums.digitalpoint.com/ or http://www.webmasterworld.com/</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-70</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-70</guid>
			<pubDate>Tue, 04 Sep 2007 22:28:56 GMT</pubDate>
		</item>
		<item>
			<title>Sam</title>
			<description>Hi,&lt;br /&gt;
&lt;br /&gt;
I am trying to use this javascript and couple it together with the ability to hide a div if you click off it, but nt hide it if you click on it. &lt;br /&gt;
&lt;br /&gt;
So you open a div that has a form in it. You click in the form and everything is normal. However if you click outside of the form div, it should close. &lt;br /&gt;
&lt;br /&gt;
Do you know of a good cross browser script to allow me to do that? .. I am currently adding onto what you have above with the following. Works in Firefox, but not ie :&lt;br /&gt;
&lt;br /&gt;
/*************************************************************/&lt;br /&gt;
/* Catch onbody clicks to initiate certain actions - Sam Allen Aug 07 */&lt;br /&gt;
var menuStatus = &amp;quot;closed&amp;quot;; &lt;br /&gt;
document.onclick = loadEventListener;&lt;br /&gt;
&lt;br /&gt;
// Function to add event listener - see what is clicked &lt;br /&gt;
function loadEventListener() { &lt;br /&gt;
    &lt;br /&gt;
    document.getElementById('locmenu_wrapper').addEventListener(&amp;quot;click&amp;quot;, stopLooking, false); // if location menu is clicked do nothing&lt;br /&gt;
	document.getElementById('defaultlocation').addEventListener(&amp;quot;click&amp;quot;, stopLooking, false); // if location box is clicked do nothing&lt;br /&gt;
	document.getElementById('container').addEventListener(&amp;quot;click&amp;quot;, checkMenuStatus, false); // check if the page is clicked anywhere, if it is check menu status &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
function stopLooking(e) // stop looking for inpage click events - stopping page bubbling and capturing&lt;br /&gt;
{&lt;br /&gt;
	if (!e) var e = window.event;&lt;br /&gt;
	e.cancelBubble = true;&lt;br /&gt;
	if (e.stopPropagation) e.stopPropagation();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function checkMenuStatus(e) // there is a valid click event now do something&lt;br /&gt;
{&lt;br /&gt;
	if (menuStatus == &amp;quot;opened&amp;quot;){ // if a menu is open&lt;br /&gt;
	hideDiv('locmenu_wrapper'); // hide this menu div&lt;br /&gt;
	hideDiv('defaultlocation'); // hide this menu div&lt;br /&gt;
	stopLooking; // stop looking for inpage click events&lt;br /&gt;
	} &lt;br /&gt;
}</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-66</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-66</guid>
			<pubDate>Mon, 03 Sep 2007 16:28:12 GMT</pubDate>
		</item>
		<item>
			<title>darrenforster99</title>
			<description>I've a few comments about this article, firstly the suggestion to hide the DIV section when it first loads, the ONLOAD function will work except if you have a few images in the DIV section.  There is an easier way to hide it at the beginning and that's to use css to hide it as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
div#hiddenid&lt;br /&gt;
{&lt;br /&gt;
  position: absolute ;&lt;br /&gt;
  left: -4000px ;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also I ammended the code a bit for a website I am making so that I could make it appear with an onmouseover event and disappear with an onmouseout event, this modification seperates the hide and show sections into seperate this makes it more object orientated and more flexible with the ways you can use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function showDiv ( elemID ) &lt;br /&gt;
{&lt;br /&gt;
 var elem = document.getElementById ( elemID ) ;&lt;br /&gt;
 elem.style.position = 'relative' ;&lt;br /&gt;
 elem.style.left = '0px' ;&lt;br /&gt;
 return ( true ) //everythings ok&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function hideDiv ( elemID )&lt;br /&gt;
{&lt;br /&gt;
 var elem = document.getElementById ( elemID ) ;&lt;br /&gt;
 elem.style.position = 'absolute' ;&lt;br /&gt;
 elem.style.left = '-4000px' ;&lt;br /&gt;
 return ( true ) ; //everythings ok&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function toggleDivOL( elemID )&lt;br /&gt;
{&lt;br /&gt;
  var elem = document.getElementById ( elemID ) ;&lt;br /&gt;
/*returns true if everything is ok*/&lt;br /&gt;
  return ( ( elem.style.position != 'absolute' ? hideDiv ( elemID ) : showDiv ( elemID ) ) ) ;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an onmouseover/out event you could use the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
or if you could still use it the same for toggle&lt;br /&gt;
&lt;br /&gt;
</description>
			<link>http://www.netlobo.com/comments/off_left_div_hiding#comment-32</link>
			<guid>http://www.netlobo.com/comments/off_left_div_hiding#comment-32</guid>
			<pubDate>Fri, 13 Jul 2007 14:29:48 GMT</pubDate>
		</item>
	</channel>
</rss>

<!-- pageGen: 0.0029 secs -->
<!-- memcache hits: 2 memcache misses: 0 -->