Author |
Message |
Misha
Worker


Joined: Jul 30, 2006
Posts: 205
Location: McLean, VA
|
Posted:
Thu Feb 15, 2007 2:14 pm |
|
I want to insert an object, the size of which has to be defined before it is created and inserted. Currently I have an object with fixed width, and I want to be a bit more flexible here. Is there anything I can query to get the current width of module table?
Thanks  |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
 |
jakec
Site Admin

Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Thu Feb 15, 2007 2:27 pm |
|
What sort of object? Image? |
|
|
|
 |
Misha

|
Posted:
Thu Feb 15, 2007 3:03 pm |
|
sort of... actually, map. I'm trying to implement driving directions using mapquest API |
|
|
|
 |
jakec

|
Posted:
Thu Feb 15, 2007 3:11 pm |
|
Oh right, I don't suppose there is anything to specify a % instead of an absolute value in the API? |
|
|
|
 |
Misha

|
Posted:
Thu Feb 15, 2007 3:15 pm |
|
I did not actually try this, but it does not make any sense to me - mapquest really has no way of knowing where I want to insert the map... |
|
|
|
 |
Misha

|
Posted:
Thu Feb 15, 2007 3:17 pm |
|
I tried. % does not work  |
|
|
|
 |
jakec

|
Posted:
Thu Feb 15, 2007 3:42 pm |
|
I had a quick go myself, but can't see anyway of doing it. Hopefully someone else here has some experience of is using this API.
Sorry I couldn't be of more help. |
|
|
|
 |
Misha

|
Posted:
Thu Feb 15, 2007 4:13 pm |
|
Thanks for trying  |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Thu Feb 15, 2007 5:05 pm |
|
I've signed up, just waiting for their email. |
|
|
|
 |
Misha

|
Posted:
Thu Feb 15, 2007 5:31 pm |
|
Thanks Guardian
I think I solved the puzzle, though. I don't think mapquest has anything dynamic in this free API, but there is a way to get window size, actually - credits to Mark "Tarquin" Wilton-Jones from http://www.howtocreate.co.uk
Code: ." function winwidth() {\n"
." var myWidth = 0;\n"
." if( typeof( window.innerWidth ) == 'number' ) {\n"
." myWidth = window.innerWidth;\n" //Non-IE
." } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {\n"
." myWidth = document.documentElement.clientWidth;\n" //IE 6+ in 'standards compliant mode'
." } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {\n"
." myWidth = document.body.clientWidth;\n" //IE 4 compatible
." } else myWidth = 800;\n"
." return myWidth;\n"
." }\n"
|
You can see how it works here: Only registered users can see links on this board! Get registered or login! |
Last edited by Misha on Wed Mar 21, 2007 8:32 pm; edited 2 times in total |
|
|
 |
Misha

|
Posted:
Thu Feb 15, 2007 5:33 pm |
|
To make it really nice some onresize handler will be good, but I just don't have any idea at the moment how such things are done... |
|
|
|
 |
fkelly
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Thu Feb 15, 2007 6:50 pm |
|
Cool but the fisubice footer is pasted right over the top of one of the maps in the sample I looked at. Cool but not fully cooked. |
|
|
|
 |
Misha

|
Posted:
Thu Feb 15, 2007 7:17 pm |
|
You probably just hit some in-between state - I'm still working on it, a lot of other bits and pieces have to be put in place...
It's not active for regular users - i just gave you guys a direct link  |
|
|
|
 |
Guardian2003

|
Posted:
Fri Feb 16, 2007 1:05 am |
|
Just a thought.....
If I remember correctly there are 2 table functions within nuke, Opentable() and OpenTable2()
The one that might be interesting is Opentable2() as this is usually a fixed width table wheras Opentable() is usually 100% (so has the potential to stretch to far).
Try wrapping your code (from your example) like this Code:
OpenTable2();
." function winwidth() {\n"
." var myWidth = 0;\n"
." if( typeof( window.innerWidth ) == 'number' ) {\n"
." myWidth = window.innerWidth;\n" //Non-IE
." } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {\n"
." myWidth = document.documentElement.clientWidth;\n" //IE 6+ in 'standards compliant mode'
." } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {\n"
." myWidth = document.body.clientWidth;\n" //IE 4 compatible
." } else myWidth = 800;\n"
." return myWidth;\n"
." }\n"
CloseTable2();
|
|
|
|
|
 |
Misha

|
Posted:
Fri Feb 16, 2007 9:47 am |
|
Thanks, Guardian.
No, I don't want to go for the fixed table - the whole idea is to have it as flexible as possible.
But it's definitely good to know.. |
|
|
|
 |
Guardian2003

|
Posted:
Fri Feb 16, 2007 12:40 pm |
|
I see, I misunderstood your post, I thought you were trying to contain the map within your own borders to stop it forcing the browser to scroll. |
|
|
|
 |
|