Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Misha
Worker
Worker



Joined: Jul 30, 2006
Posts: 205
Location: McLean, VA

PostPosted: Thu Feb 15, 2007 2:14 pm Reply with quote

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 Smile

_________________
http://www.funandsafedriving.com/defensive-driving.html 
View user's profile Send private message Visit poster's website
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Thu Feb 15, 2007 2:27 pm Reply with quote

What sort of object? Image?
 
View user's profile Send private message
Misha







PostPosted: Thu Feb 15, 2007 3:03 pm Reply with quote

sort of... actually, map. I'm trying to implement driving directions using mapquest API
 
jakec







PostPosted: Thu Feb 15, 2007 3:11 pm Reply with quote

Oh right, I don't suppose there is anything to specify a % instead of an absolute value in the API?
 
Misha







PostPosted: Thu Feb 15, 2007 3:15 pm Reply with quote

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







PostPosted: Thu Feb 15, 2007 3:17 pm Reply with quote

I tried. % does not work Sad
 
jakec







PostPosted: Thu Feb 15, 2007 3:42 pm Reply with quote

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







PostPosted: Thu Feb 15, 2007 4:13 pm Reply with quote

Thanks for trying Wink
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Thu Feb 15, 2007 5:05 pm Reply with quote

I've signed up, just waiting for their email.
 
View user's profile Send private message Send e-mail
Misha







PostPosted: Thu Feb 15, 2007 5:31 pm Reply with quote

Thanks Guardian Smile

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 [ Only registered users can see links on this board! Get registered or login! ]

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: driving directions


Last edited by Misha on Wed Mar 21, 2007 8:32 pm; edited 2 times in total 
Misha







PostPosted: Thu Feb 15, 2007 5:33 pm Reply with quote

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

PostPosted: Thu Feb 15, 2007 6:50 pm Reply with quote

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.
 
View user's profile Send private message Visit poster's website
Misha







PostPosted: Thu Feb 15, 2007 7:17 pm Reply with quote

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 Wink
 
Guardian2003







PostPosted: Fri Feb 16, 2007 1:05 am Reply with quote

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







PostPosted: Fri Feb 16, 2007 9:47 am Reply with quote

Thanks, Guardian.
No, I don't want to go for the fixed table - the whole idea is to have it as flexible as possible. Smile
But it's definitely good to know..
 
Guardian2003







PostPosted: Fri Feb 16, 2007 12:40 pm Reply with quote

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.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©