View Single Post
Old 07-28-2011, 02:02 PM  
harvey
Confirmed User
 
harvey's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
Quote:
Originally Posted by MediaGuy View Post
If you hardcode it into you index.php (in your menu goto Appearance/Editor and change to default style sheet), you'd have to maybe limit the number of posts on the index page to one or two if you want to put the map below the main content, otherwise it will appear a long scroll down from first loading.

You could also hardcode it above the main content so it's the first thing they see - but I don't think you can break up the posts themselves with the map - unless you want it occurring beneath every post?

:D
first paragraph is true. Second isn't, it's very easy to "break" into the loop, but I don't know if this is what he wants, to me it looks like he wants what you say in the first paragraph

anyway, a neat way to achieve this without affecting flow is as follows:

first add this code between <head></head> tags:

Code:
<script language="javascript"> 
function toggle() {
	var ele = document.getElementById("hideMap");
	var text = document.getElementById("showMap");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "show";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "hide";
	}
} 
</script>
then, right before the loop starts (in index.php), add this:

Code:
<a id="showMap" href="javascript:toggle();">Show Map</a> 
<div id="hideMap" style="display: none">{insert your map code here}</div>
and that's it, now you can hide and show your map without affecting the flow!
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth
harvey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote