Welcome to TalkGraphics.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2011
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    39

    Default Looking for some magic...

    My page HERE is getting very close to what I want it to be. But I need a bit of magic to finish the job.

    When you click a U.S. state abbreviation at the top of the window, the list below it scrolls to that state's entries.

    When you click the | Map | link, also at the top of the window, you see a popup layer with a map that shows all the entries on the list.

    You close the map by clicking anywhere on it.

    While the map is showing, you can click any of the state abbreviations, and the list will scroll to the entries for that state. The map, however, continues to display, and it obscures the entries.

    The magic I need is this: How can I make the map close when an abbreviation is clicked, without interfering with the scrolling to the proper state?

    (I want users to be able to call up the map, find a location they are interested in, click its abbreviation, and be able to use the directory without the extra step of closing the map.)

  2. #2

    Default Re: Looking for some magic...

    Hi Lou,

    Again, shooting in the dark as I haven't mucked around much in the web features of XDP...But, a window opened by javascript can be reliably closed with javascript. So, any window opened by javascript can be made to close when it loses focus. Just the script below in between the head tags of the page:

    <script type="text/javascript">
    window.onblur=function(){self.close();};
    </script>

    The onblur function simply tells the window, "Oh, someone just clicked off me, so I'll close now." The give a heck is that I don't know whether--but it is likely that--the window is opened via javascript. If not, you'll need to figure out another way to automagically close the window.

    Take care, Mike

  3. #3

    Default Re: Looking for some magic...

    Quote Originally Posted by Lou Sander View Post
    You close the map by clicking anywhere on it.
    If you have used (lock) appended to the layer name, this prevents the layer from closing unless you link popup:close to an object on that layer, clicking will then close that layer.
    This appears to be what you have done.
    If you don't do any of this, then the layer will still popup as required, but will disappear as soon as you click anywhere else. This seems to be what you want.
    So remove the (lock) from the layer name and your magic will happen.

  4. #4
    Join Date
    Jul 2011
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    39

    Default Re: Looking for some magic...

    ShapeShifter: It sounds like you are onto something, but I'm in the dark about it. I know very little about layers, naming them, etc. The layer that the map is on is named Map. It shows up as unlocked in my Page and Layer Gallery. As far as I know, I didn't do anything to lock it, append "(lock)" to it, etc.

    I've experimented a bit, and the map DOES disappear when I click on it or ALMOST anywhere else. This includes the mottled area at the top of the page, the footer at the bottom, and any of the white area in the two rows of state abbreviations.

    The map does NOT disappear when I click anywhere on the vertical scroll bar or on anything to its left, all of which is in an iframe. (I know very little about iframes, except how to put one on this web page. This one is in a placeholder that covers everything from left to right.) Also it does NOT disappear when I click any of the state abbreviations in the list at the top (as opposed to the white space around and between them).

    Things would be working exactly as I want if the map disappeared when I clicked one of those abbreviations/links. I'm indifferent as to what happens to the map if I click on the iframe.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •