Creating a "Limit" For page content

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
~BlitZ
Forum Newbie
Posts: 22
Joined: Mon Feb 23, 2009 5:36 pm
Location: United Kingdom

Creating a "Limit" For page content

Post by ~BlitZ »

Heya guys, I own a game called Beast Hero, I am in the process of re-creating the map interfaces so it will work well in most common browsers & resoloutions, The trouble i'm having is that i think of a way to limit the content on a page.
Here's what i'm trying to do.

So i have the map, I can set whatever width's i want for the map, But it will make the page scroll, I don't want this, I want a "Boundry" if you like at the edge of the page so that the map cuts off, Instead of loading the whole map and scrolling.

Is there any way of doing this?
Please & Thank you.
Randwulf
Forum Commoner
Posts: 63
Joined: Wed Jan 07, 2009 7:07 am

Re: Creating a "Limit" For page content

Post by Randwulf »

I think we're going to need a few more details.

This is in PHP?
How are your maps implemented?
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Creating a "Limit" For page content

Post by papa »

I'd suggest either an Iframe or using JS but that might be a lot of work if you need to re-program the map.
~BlitZ
Forum Newbie
Posts: 22
Joined: Mon Feb 23, 2009 5:36 pm
Location: United Kingdom

Re: Creating a "Limit" For page content

Post by ~BlitZ »

Well the map can be sent to the browser, In all sorts of hiehgts and widths, You can set how big you want the map to be, The thing im trying to do is make something like an Iframe, I might maywell use an Iframe.

also, I have been researching the .scrollTop; & .scrollLeft; functions in Javascript.

I am just totally stuck on how i would do this, I was thinking of creating a script where it checks when the player clicks to move on the map, If it is going left it will scroll left on that function by 32px, If it goes right it would scroll right ect.

I was looking through my database and i think i have an "Idea" on how i would do this.

Create a variable where it gets the database value for Map_Left (x) and Map_Top (y), If the value goes below that value scroll left, If it is higher, Scroll right.

That is my idea anyway. Anymore thoughts?
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Re: Creating a "Limit" For page content

Post by Bill H »

Shouldn't this be on Client Side forum? Not being picky, but you might get better results there, given that the topic seems to have to do with that subject.
~BlitZ
Forum Newbie
Posts: 22
Joined: Mon Feb 23, 2009 5:36 pm
Location: United Kingdom

Re: Creating a "Limit" For page content

Post by ~BlitZ »

Yes, Sorry it probably should, Sorry, Shall i re-create this thread there or ask for a mod to move it?
Post Reply