![]() |
Scalable image menu not working with Javascript
Hi,
I'm probably doing something daft here, but I haven't been able to figure it out, so after 4hrs trying I'll try and explain... I'm trying to build a scalable image based menu for my front page, to direct my clients to various sites depending on their choice, up until now the image size has been fixed, which isn't so great for iPad's, iPhones....you catch my drift. So I've pretty much hacked my site and got the image scalable, but I'm struggling with the hit areas as they don't seem to be able to position themselves properly (left to right) despite lots of attempts to make them behave. I can manually line them up in css, but because it's a dynamically sized image that breaks everything on different size screens, so I'm having to take a crash course in Javascript. My test page is currently at http://www.purephotos.co.uk/test-menu/ and hopefully you will be able to see what I'm trying to do. The code that moves the hit areas around should all be visible in the source code view as I'm using Javascript in the page to do the work for me. Any help getting everything lined up would be hugely appreciated. Thanks in advance |
Each image looks to be 166px in width.
Code:
#region1{ |
That won't work because the image is scalable so for you it's 166, for me it's 250 which would make the hit areas all wrong on my screen, the 'left' attribute has to be set onLoad so we know how big the image is and therefore how big the hit area needs to be. Hence the JavaScript.
Thanks for trying! |
I would use a different style sheet 4 each resolution.
Edit: I would personally suggest CSS. http://www.fuelyourcreativity.com/ho...-your-website/ extras: http://www.blissfulinterfaces.com/ma...es-responsive/ http://css-tricks.com/resolution-specific-stylesheets/ http://www.javascriptkit.com/dhtmltu...aqueries.shtml http://dev.w3.org/csswg/css4-images/#image-set-notation |
As I said....
Quote:
Does anyone else have any ideas? |
| All times are GMT +1. The time now is 01:09 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.