Results 1 to 4 of 4

Thread: Switch Content Script - dynamic use

  1. #1
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Switch Content Script - dynamic use

    Hello,

    I am new to the web design and to the use and adaptation of different scripts.
    I really liked the switch content script but I don't know what exactly to modify on my table so to make the script working.
    You can see my page on www.film-francais.com.

    What I would like to do is when you click on the Title ("Titre"), a new row opens just below and there you could read the sysnopsis of the film (another field retrieved from the db).
    The fields of my db are: Id,Titre, Realisateur,Annee, Sysnopsis; ets.
    Something like http://www.comscripts.com/scripts/php.phpmyshop.1114.html in the middle of the page - "Les commentaires" (the comments), and when you click on one of them, you got the requested information.

    Many many thanks in advance,
    Vassil

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here is their script:
    Code:
    <script type="text/javascript">
     function OpenLayer(id){
       if(document.getElementById(id).style.display == "block") {
        document.getElementById(id).style.display = "none" ;
    
       } else {
        document.getElementById(id).style.display = "block" ;
    
       }
       window.status =  document.getElementById(id).style.display;
     }
    </script>
    and here is an example of their markup that uses it:
    Code:
      <table border="0" width="100%" cellspacing="1" cellpadding="1">
       
       <tr bgcolor="#FFFFFF">
    
        <td><a href="javascript:OpenLayer('commentaire1');"
          onmouseout="window.status='';return true;" onmouseover="window.status='Les Commentaires';return true;">
          <b>Bon de commande en PDF ?</b></a></td>
    
        <td align="left">
         par     <a href="/scripts/?auteur=9275">Fred VICTOR</a>
        </td>
        <td nowrap="nowrap" align="center">
             <img src="/images/star/star_9.gif" width="55" height="12" alt="9/10" /></td>
           </tr>
       <tr>
        <td colspan="3" bgcolor="#F2F5F7">
         <div id="commentaire1" style="display:none">
          &nbsp;Le : <u>20-04-2005</u>
                <blockquote>
          bonjour &agrave; tous <br />
    pour ma part tr&eacute;s satisfait de ce script, je me demandais si gr&acirc;ce &agrave; FPDF il y aurait possibilit&eacute; de g&eacute;n&eacute;rer le bon de commande en PDF. Ceci permettrait tr&eacute;s simplement de l'imprimer OU de l'adresser par mail pour compl&eacute;ter un paiement en ligne (Paypal par exemple). Je pense que c'est possible mais je ne suis pas personnellement assez bal&eacute;ze pour l'aboutir. Si d'aucuns veulent si int&eacute;resser ... </blockquote>
         </div>
        </td>
       </tr>
    I'm not wild about the some of the methods used but, it is simple and shows one important feature of any set-up of this kind. The content to be expanded is in a division (<div>) inside a table cell (<td>) not a table element (<table>, <tbody>, <tr> or <td>) itself.

    Colors:

    Blue: essential script calls & style
    Red: id used for this particular case, each case needs a unique id
    Green: added features, that either enhance (mouse events) or allow for proper display/format (colspan=3 - spans the width of this three column table).

    You normally should ask permission to use this but, if I could read French, I think I might see that the page is a demo or leads to a demo. I take it that you read the language so, you decide.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John,

    I will try again.
    The difficulty for me come to the right synxat to use when the data source is a db.

    Once again - thanks,
    Vassil

  4. #4
    Join Date
    Jul 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well its now working, I was trying the script locally by just dropping my page into a web browser but now its being served it works.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •