ok I have a link that looks like this

<a href="briefcase.php?q=[PAGE_ID]" onMouseover="tip('Click to view<BR> [PAGE_TITLE] <BR> Briefcase')";
 onMouseout="hidetip()" onClick="briefcase.php?q=[PAGE_ID]" "return overlay(this, 'subcontent2', 'middlebottom')"><IMG BORDER=0 SRC="images/icons/briefcase.png"></A>

now I want the value of q to carry over into the overlay so I can determine what ads to show....

Thank You for Your Help.

    I'm not sure what you're asking or how that works, because what you've shown is is invalid HTML...

    onClick="briefcase.php?q=[PAGE_ID]" "return overlay(this, 'subcontent2', 'middlebottom')"

    The onClick value isn't valid JavaScript. What is that second string supposed to do?

      $TEMPLATE["PAGES"]["PAGE"] = <<<EOF
      	<P><A HREF="[PAGE_URL]"><B>[PAGE_TITLE]</B></A><BR>
      	[PAGE_DESCRIPTION]<BR>
      	[PAGE_URL]<BR>
      
      <table width=100 border=0>
        <tr>
          <td><div align=center><a href="[PAGE_COMMENT]" onMouseover="tip('View Comments')";
       onMouseout="hidetip()"><IMG BORDER=0 SRC="images/icons/comment.png"></A></div></td>
      
      <td><div align=center><a href="[PAGE_ID]" onMouseover="tip('Click to view<BR> [PAGE_TITLE] <BR> Briefcase')";
       onMouseout="hidetip()" onClick="return overlay(this, 'subcontent2', 'middlebottom')"><IMG BORDER=0 SRC="images/icons/briefcase.png"></A></div>
      	

      ok

      this is part of my template file for a dir structure.

      it runs through a loop gathering all the ads.

      now when you click a link a div overlay shows up.
      inside the overlay it has a small 5-button navigation

      each link has a [PAGE_ID] which comes from the database.

      Now How can I carry over [PAGE_ID] to the div overlay?

      I mean when a link is clicked how can I carry over the page id.

      How do I embed the [PAGE_ID] into the onclick statement?

      do you need to see this in a working environment?

        Sounds like a question that deals with the JavaScript code that creates the div, not PHP (in which case we'd need to see the related JS code).

          <script type="text/javascript">
          
          function getposOffset(overlay, offsettype){
          var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
          var parentEl=overlay.offsetParent;
          while (parentEl!=null){
          totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
          parentEl=parentEl.offsetParent;
          }
          return totaloffset;
          }
          
          function overlay(curobj, subobjstr, opt_position){
          if (document.getElementById){
          var subobj=document.getElementById(subobjstr)
          subobj.style.display=(subobj.style.display!="block")? "block" : "none"
          var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
          var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
          subobj.style.left=xpos+"px"
          subobj.style.top=ypos+"px"
          return false
          }
          else
          return true
          }
          
          function overlayclose(subobj){
          document.getElementById(subobj).style.display="none"
          }
          
          </script>

          that is the js that controls the DIV Overlay

            Write a Reply...