Just to start off, I have been having fun with this module, but it is difficult to find answers since it's different than the jstools tabs. The main reason I chose it was due to the ajax loading function.

I can get a custom google map api working in the tab, but if I change tabs and go back it is no longer visible. Can some one provide a solution to this. I see solutions for jstools tabs, but can't get one to work in magic tabs.

Thank you

Comments

yhager’s picture

Can you provide the code you used for your callback?

pwieck’s picture

The top of my module

function lake_layout_magic_tabs($active = 0) {
  if (arg(0) == 'node' && is_numeric(arg(1))) {
    $node = node_load(arg(1));
    node_build_content($node);
  }

The rest of the module is straight from the example and <?php print magic_tabs_get('lake_layout_magic_tabs'); ?> is what I pasted in the contemplate area. Then in the page.tpl I pasted my google api javascript. Initialized the google function with body onload. Then in my custom module I just put $test2 .= '<div id="map_canvas" style="width: 500px; height: 300px"></div>'; and then 'content' => $test2,.

I know this is super cude, but it is the best I know how to do for now. I'm learning everyday. I know just enough to be dangerous:)'

Thank you.

webrascal’s picture

I'm doing a bit of hunting around trying to find which tabs module I should implement on my next project and having stumbled on this hopefully I could help you out here a bit.

What you may be experiencing is some race condition conflicts with your body onload call and the way jquery expects things to happen and in which order.

If I were you I'd look into getting your google map javascript executed through the jquery instead of the body onload call.

Have a read through here (http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery) to see if you can get your head into it a bit more, specifically this area:

 $(document).ready(function() {
   // do stuff when DOM is ready
 });

This may or may not fix your problem, but it could at least rule out race conditions being a problem.

Good luck!

pwieck’s picture

Status: Active » Closed (fixed)

Unsupported version of drupal