Okay I will try to explain this as best as I can... I have a layout that has 2 parts Left Navigation and Main Content The main content part of the page is a lot longer in the left nav. So once you scroll down a little bit the left nav is no where to be found but the main content continues to scroll. I was wondering if there was a way to see if the user has scrolled past the left nav part using javascript? My idea is once they scroll past the left nav I will place an adsense ad where the left nav should be and make it static. So when the user continues to scroll my adsense ad will be in the same place the whole time.
It would be better to create individual pages. Have a progressively more enticing, big link to the next page, etc. You could easily track the visitors from page to page.
Thanks for the help but I figured it out. When a user scrolls past the left navigation I set the ad to fixed and it will stay on the screen no matter how far down the user scrolls. Once the user scrolls back up and the left nav is shown again the ad will slide back into place where it belongs. Here is the code I used if anyone is interested. <script type="text/javascript" language="javascript"> window.onscroll = checkScroll; function checkScroll(event){ if(getScrollXY() >= 1200){ document.getElementById('leftAd').style.position="fixed"; document.getElementById('leftAd').style.top="100px"; } else { if(document.getElementById('leftAd').style.position == "fixed"){ document.getElementById('leftAd').style.position=""; document.getElementById('leftAd').style.top=""; document.getElementById('leftAd').style.left=""; } } } function getScrollXY() { var scrOfY = 0; if(typeof(window.pageYOffset) == 'number'){ scrOfY = window.pageYOffset; } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)){ scrOfY = document.body.scrollTop; } else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)){ scrOfY = document.documentElement.scrollTop; } return scrOfY; } </script> Code (markup): That's the javascript that will check to see how far down the user has scrolled <div id="leftAd">ADSENSE CODE HERE</div> Code (markup): That's the div that will change location based on how far the user has scrolled
Why don't you just have ads all the way down, after the navigation bar, rather than just one lonely one at the top?
Well google only allows 3 ads per page. Also what I've noticed is the more ads you have on a page the worse your CPC is. Not to mention the space from the bottom of the left nav to the footer is well over 2000px so I would need a bunch of ads there to fill the gap. I think the way I went about doing it is a lot more user friendly and I don't need to have ads all over the place. With just 1 ad I can place it in the left nav and it looks good. When the user scrolls down the ad will follow them and it still looks good. Not to mention that the adsense ad is always in their sight so it increases the CTR.