![]() |
How to replicate my map for other levels?
Hello,
I would like to know how to replicate the map and it's features multiple times for the other zoom levels, the only difference is that there'll be different td styles, getting smaller and smaller. Link: https://tornhq.com/Events/HallowTown/index-New.html Best Regards, Tim |
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
Thank you for your help vwphillips.
Edited: https://tornhq.com/Events/HallowTown/Multiple.html Non-edited: https://tornhq.com/Events/HallowTown/index-New.html Although what you have done does add a new zoom level of the map, the double click feature no longer works. Also, to add another layer do I simply make another TD ID, lets say it's called zoomed60 and add it to the Javascript like so? Code:
Map('Zoomed60',map,classes)Tim |
Ummm...I don't think this is the right approach.
I may be way off base, but I *THINK* the answer is much much easier. Demonstrating with the code I posted before. You can see how to adapt it to your new version. Changes in red, as usual. Code:
|
Oh...and yes, it works like a charm.
And because there is ONLY ONE "layer", there will be no impact on any of the JS code. In fact, JS will not be aware of the change, except insofar as you might be looking at the width and height of the map as I showed you. |
And by the way, "Sheriff" is the correct spelling. Double-F, not double-R.
|
This map currently allows for mouse-wheel and the usage of the buttons under the "Move around the Map" tab.
It appears what you have done changed it for a radio button? Best Regards, Tim |
READ WHAT I WROTE:
Quote:
|
Okay, thank you Old Pedant.
As I 'm still learning, I do not yet know exactly how to implement this... I gather I have to do something here; Code:
$(".map-control a").click(function() {//control panelSorry for my lack of knowledge and I am so grateful for your help! |
Sorry, I don't use jQuery.
I don't see how that code is relevant to changing the zoom level, at all. It *LOOKS* like that code indeed is loading a *NEW* map into the "viewport". WHY??? You only need one map. You just need to change the className of the map. And why is a click on an <a> element used to change the zoom?? EDIT: Never mind. I see. Your + and - "buttons" are actually <a> elements. Why??? Why aren't they simply <img> elements? You can have onclick on an <img> element and then you don't have to cancel the effect of the onclick so that the <a> doesn't do the wrong thing. |
OH UGLY UGLY UGLY!
NOW I see what you have done! Code:
<div id="viewport2">THIS IS A KILLER! I think you have made a HUGE mistake! OF COURSE everything you do when you change zoom levels is NOW WIPED OUT. Just because two cells have the same ID in different maps does *NOT AT ALL MAKE THEM THE SAME CELL!* And, just incindentally, it's illegal to have two or more elements with the same ID in the first place! Look, instead of doing it this way, just have the *ONE* <div>. Code:
<div class="mapwrapper">And then you *AUTOMATICALLY* also change the height and width of document.getElementById("mapHolder") [I just added that id] to match the size of the re-sized (zoomed) <table>! And you do that by getting the new size of the <table> all in JS code! Example: Code:
tbl.className = "zoom" + zoomLevel; // where zoomLevel is 100,75, or 50...or whatever you choose |
|
By the by, I just tested that in my own version of your gameMap (the code I posted in post #4, above) and it works like a charm.
|
Quote:
But I *think* that if you used what I suggested, it would probably work even with that code. Just be sure to *NOT* use their zoom code. By the by, I think I could replicate all the functionality of that code that you are actually using in about half the number of lines. Just by avoiding jQuery. (Well, there's very little in there that actually depend on jQuery, for that matter.) |
I'll implement what you have said in a moment, I am waiting on a take-away order and I might loose track is I start now.
Thank you again :) Oh and if I don't message again within 35 minutes... ...HAPPY NEW YEAR! I hope this year is better than the last! |
| All times are GMT +1. The time now is 09:46 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.