Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    I'm sorry, I still don't understand WHERE this menu that shows the clicked on id is supposed to appear.

    You mean you *DO* want it to show in that small map space??? It seems to me like that space is so limited already it would be better if it appeared to the side or above, even if it temporarily covered up another part of the display.

    **********

    I don't understand *WHAT* height and width you are trying to calculate. Or of what, if you will.

    I agree about double click: If you are trying to work with as many devices as possible, I would avoid that. My wife uses a NOOK, for example, and double click is nearly impossible on it. You can try a dozen times before it works.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  2. #17
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Oh...you want the height and width OF THE FULL MAP!

    Don't calculate it! ASK for it!

    In my code, for example, you could get it as indicated:
    Code:
    ...
          // set up all the cells:
          for ( var r = 0; r < theMap.length; ++r )
          {
              var row = theMap[r];
              var tr = tbl.insertRow(-1);
              for ( var c = 0; c < row.length; ++c )
              {
                  var cell = tr.insertCell(-1);
                  cell.id = "C" + (theMap.length - r) + "_" + (c+1);
                  cell.className = classes[row.charAt(c)];
                  cell.onclick = cellClick;
              }
          }
    alert( tbl.scrollWidth + " by " + tbl.scrollHeight );
         ...
    You, of course, would store the values rather than alert them.

    On Chrome, I got 2396 by 1192.
    Ahh...good...MSIE 9 gave the same answer!
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  3. #18
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    And I have to give up for the night. You have 5 minutes.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  4. #19
    Regular Coder
    Join Date
    Nov 2010
    Posts
    378
    Thanks
    46
    Thanked 1 Time in 1 Post
    Eak 5 mins!

    The bottom right box area, I'll place a tab there fore the information as your right, the map area is quite small...

    And thank you so very much!

  5. #20
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Okay...that will work great.

    You could do something simple:
    Code:
                	<div id="move_around" class="tab_content" style="position: relative;display: block;">
                        <div class="map-control" style="position: absolute; z-index: 1;">
                            <a href="#left" class="left">Left</a>
                            <a href="#right" class="right">Right</a>
                            <a href="#up" class="up">Up</a>
                            <a href="#down" class="down">Down</a>
                            <a href="#zoom" class="zoom">Zoom</a>
                            <a href="#zoom_out" class="back">Back</a>
                        </div>
                        <div id="popon" style="position: absolute; z-index: 99; display: none;">
                            You just clicked on cell <span id="whichClicked"></span>
                            <br/>
                            The cell type is <span id="typeClicked"></span>
                            <br/>
                            <i>(click to close)</i>
                        </div>
                    </div>
    And then change the code for the callClick function to just this:
    Code:
          function cellClick( )
          {
              clk.innerHTML = this.id;
              typ.innerHTML = this.className;
              pop.style.display = "block";
          }
    What could be simpler? And of course then go clean up my ugly styles.

    G'Night.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  6. #21
    Regular Coder
    Join Date
    Nov 2010
    Posts
    378
    Thanks
    46
    Thanked 1 Time in 1 Post
    I know this should be fairly straight forward, however when I delete;

    Code:
                        <div id="popon" style="display:block; margin-top: 100px;">
                            You just clicked on cell <span id="whichClicked"></span>
                            <br/>
                            The cell type is <span id="typeClicked"></span>
                            <br/>
                            <i>(click to close)</i>
                        </div>
    Where it currently is, the map breaks, I cannot seem to follow what you've said above correctly to get it to work...

    Best Regards,
    Tim

  7. #22
    Regular Coder
    Join Date
    Nov 2010
    Posts
    378
    Thanks
    46
    Thanked 1 Time in 1 Post
    On second thoughts, where the content shows for the tabs, I'll have it displayed there for the entire space and have an [x] in the corner, but not as one of the tabs contents.

    However I am very tired at this moment in time and cannot even find out how the...
    Code:
        <i>(click to close)</i>
    ...Closes the div!

  8. #23
    Regular Coder
    Join Date
    Nov 2010
    Posts
    378
    Thanks
    46
    Thanked 1 Time in 1 Post
    I've got it all working and neatened up a little

    Oh and the double click has been implemented now
    Last edited by MrTIMarshall; 12-30-2012 at 09:45 AM.

  9. #24
    Regular Coder
    Join Date
    Nov 2010
    Posts
    378
    Thanks
    46
    Thanked 1 Time in 1 Post
    It's all working fine for myself on Google Chrome, however my friend using FireFox says it is not working when you double click on the menu.

    I cannot test as I've not yet installed FireFox on this system and I am currently off to bed in case anyone looking at this is using FireFox.

  10. #25
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Quote Originally Posted by MrTIMarshall View Post
    On second thoughts, where the content shows for the tabs, I'll have it displayed there for the entire space and have an [x] in the corner, but not as one of the tabs contents.

    However I am very tired at this moment in time and cannot even find out how the...
    Code:
        <i>(click to close)</i>
    ...Closes the div!
    Don't know how yo missed it. I even COMMENTed it. (HINT: Use comments in your own code!)
    Code:
          // handle click-to-close
          pop.onclick = function( ) { this.style.display = "none"; }
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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