Jump to content

Pop-up menu & jump text


hoachen

Recommended Posts

I have a map that contains pacific, west north, south north that I created these regions by using hotspot selection. Within these regions each region contains a difference list of webpage from the pop-up menu. When the users mouseOver on let say Pacific a list of aaaa, bbbb,cccc. Then the user select aaa, it will bring the user to that aaa page and jump to pacific region. Right now, my problem is when I selected aaa, it will bring me to that page but it will not automatically jump to pacific region. I did tried to put mm_menu_0222091948_0.addMenuItem("aaaaaaa","location='index.htm#Pacific'","target='mainFrame'");the #Pacific and target=”mainframe” but it is not working.If you want to know more and give your precious advice, please visit the page at http://www.missouri.edu/~schvbf/us%20map/frontPage.htm

Link to comment
Share on other sites

I don't know of any way to do it without some kind of scripting - but just because I don't know it doesn't mean there isn't one.If you add this script to your content page, it will check the parent's url for an anchor and use it on itself

<script>	function getUrlAnchor(url){  url = ""+url;	  aIndex = url.lastIndexOf( '#' );  a = ( aIndex > 0 ) ? url.substring(aIndex, url.length) : "";  return a;	}	function moveToAnchor(anchor){	  window.location.assign( window.location + anchor );	}parentAnchor = getUrlAnchor( window.top.location )+ "";thisAnchor = getUrlAnchor( window.location ) + "";if( parentAnchor != thisAnchor && parentAnchor != "") moveToAnchor( parentAnchor  );	</script>

Just paste the above code between the <head> tags of content.htmHopefully someone else might have heard a way to do it without using scripts...

Link to comment
Share on other sites

thank you very much for help but it does not work. I know this is kind of unusual question and hard to get someone to answer. thank again and I hope somebody done this before and will share their knowledge. cheershoachen

I don't know of any way to do it without some kind of scripting - but just because I don't know it doesn't mean there isn't one.If you add this script to your content page, it will check the parent's url for an anchor and use it on itself
<script>	function getUrlAnchor(url){  url = ""+url;	  aIndex = url.lastIndexOf( '#' );  a = ( aIndex > 0 ) ? url.substring(aIndex, url.length) : "";  return a;	}	function moveToAnchor(anchor){	  window.location.assign( window.location + anchor );	}parentAnchor = getUrlAnchor( window.top.location )+ "";thisAnchor = getUrlAnchor( window.location ) + "";if( parentAnchor != thisAnchor && parentAnchor != "") moveToAnchor( parentAnchor  );	</script>

Just paste the above code between the <head> tags of content.htmHopefully someone else might have heard a way to do it without using scripts...

Link to comment
Share on other sites

But it does work...What do you mean by "it does not work"?Try changing the script in content.htm to this:

	function getUrlAnchor(url){  url = ""+url;	  aIndex = url.lastIndexOf( '#' );  a = ( aIndex > 0 ) ? url.substring(aIndex, url.length) : "";  return a;	}	function moveToAnchor(anchor){	  window.location.replace( window.location + anchor );	}	function moveToParentAnchor(){    parentAnchor = getUrlAnchor( window.top.location )+ "";  thisAnchor = getUrlAnchor( window.location ) + "";  if( parentAnchor != thisAnchor && parentAnchor != ""){ 	 moveToAnchor( parentAnchor  );  }	}

The first two functions stay the same as before (except using replace instead of assign)...Now, for content.htm, set the onload attribute of the body tag to "moveToParentAnchor()" like this

<body onload="moveToParentAnchor()" >

I tested the original on my localhost, which is quick, so there was no problem. But I guess when the pages are on the web they take a little longer and the browser wasn't dealing with it well. I tested the version making use of the body tag's onload attribute on the web and it works fine(a working copy of your pages with the script added can be found herehttp://brown.50webs.com/test/frame_anchor_url/frontPage.htm )Sorry for the oversight, hope it works for you this time. If not, let me know...BTW... You previously tried using the target attribute of the <a> tag, but that will not work because that target doesn't even exist until the next page is loaded - so your frontPage.htm has no way to be aware of the individual frames in the next page.

Link to comment
Share on other sites

A ton of thanks to sbrownii, it works now. The reason was I didn't put the onLoad on the contents page.Thanks for everything.cheers,hoachen

thank you very much for help but it does not work. I know this is kind of unusual question and hard to get someone to answer. thank again and I hope somebody done this before and will share their knowledge. cheershoachen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...