0

I'm trying to open up a node via the Drupal 7 Colorbox Node module on a basic page using jQuery and hooks from a map. I can get colorbox to put up a HTML pop-up using this code:

 <script type="text/javascript"> 
 simplemaps_worldmap.hooks.click_state = function(id){
     if (id == "USTX") {
         jQuery.colorbox({width:"40%", height:"40%", html:'<h3>Distributors for Texas</h3><br /><p><a target="_blank" href="./content/distr-1">Distributor 1</a><br /><a target="_blank" href="./content/dist-2"}>Distributor 2</a><br /><a target="_blank" href="./content/dist-3"}>Distributor 3</a></p><p><br />Click on the Distributor for more information</p>'});
  }
  </script>

But what I would like to do is set up a content type for state and add the info there. Then use the colorbox node module to display that content when the state is clicked. The closest I can come is to open a pop-up with a link that can be clicked that then opens the colorbox node page.

  <script type="text/javascript"> 
  simplemaps_worldmap.hooks.click_state = function(id){
      if (id == "USTX") {
          jQuery.colorbox({href:'<a class="colorbox-node" href="./content/TX?width=600&height=600">TEXAS</a>' });
  } 
  </script>

How can I make the colorbox node module work using javascript or jQuery?

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.