Collapse element question?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tril0Byte
    Member
    • Oct 2001
    • 72
    • 3.0.6

    Collapse element question?

    Hi guys, I wonder if someone can help?

    First off, let me explain what I'm trying to do. I have a left hand sidebar with a menu, I want my members to be able to turn it off and on with a switch. I'm trying to do it with the collapse elements tag but with mixed sucess - well it works in IE6, but falls flat in Firefox and I dont know why.

    Here's what I have so far...

    you can see the little graphic in the navbar that turns the menu on...



    ...here it is in the "on" state, with the menu visible...



    It seems to work OK with IE, it remembers which state it's supposed to be, through page refresh and so on. However it doesnt work properly in Firefox, which I cant figure out why because all the other collapsable elements work fine.

    Here's what I've done:

    I have two images in my "buttons folder"....

    collapse_sidebar_collapsed.gif
    collapse_sidebar.gif

    Here's the code I have in my navbar....

    PHP Code:
    <td class="vbmenu_control"> <a href="" onclick="return toggle_collapse('sidebar')"><img id="collapseimg_sidebar" src="$stylevar[imgdir_button]/collapse_sidebar{$GLOBALS['vbcollapse']['collapseimg_sidebar']}.gif" border="0" /></a></td
    Here's what I have in the sidebar table (which I've put in the forumhome and forumdisplay templates)....

    PHP Code:
    <td style="width:150px" id="collapseobj_sidebar" style="{$GLOBALS['vbcollapse']['collapseobj_sidebar']}valign="top">$sidebar</td
    I followed the tips in this thread and tried the variations suggested there, starting with the simplest and moving to the more complex code which calls $GLOBALS (thinking it is falling over because I have the collapse image in a "...bits" template).

    As I said, it seems to work OK in IE (some minor wierdness when a page is loaded with the navbar, but doesnt have the collapsable element in the page content). But it doesnt work at all in Firefox.

    Can anyone help?

    Thanks.
    BritishBlades :: Cutsom Knives
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Maybe a rendering issue with the HTML for the collapsable element once it is displayed.

    It is kind of odd to have a collapsable table in the navbar like that. Did you mean to add a popup menu? Last post in this thread.

    Comment

    • tril0Byte
      Member
      • Oct 2001
      • 72
      • 3.0.6

      #3
      Originally posted by Jake Bunce
      Maybe a rendering issue with the HTML for the collapsable element once it is displayed.

      It is kind of odd to have a collapsable table in the navbar like that. Did you mean to add a popup menu? Last post in this thread.
      No, not popup. I want a permanent menu, but one users with low screen res can turn off if they find it makes the site difficult to navigate/view.

      It's a skin under construction, but I've enabled it so you can see what I've done...
      britishblades.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, britishblades.com has it all. We hope you find what you are searching for!
      BritishBlades :: Cutsom Knives

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        I see funky HTML in your source:

        Code:
        <!-- Sidebar -->
        [color=red]<table width="100%" cellpadding="6" cellspacing="0" border="0">
        
        	<tr>
        		<td style="width:150px" id="collapseobj_sidebar" style="" valign="top"><table cellpadding="0" cellspacing="0" border="0" class="tborder" width="170" align="center">
        
        </table>[/color]
        <!-- navigation block -->
        <table  border="0" cellpadding="6" cellspacing="1" class="tborder" width="170">
        		<tr>
        		<td class="tcat"><span class="smallfont"><b>» Navigation</b></span></td>
        
        	</tr>
        	<tr>
        I assume the red code is the collapsable menu. No doubt FF is choking on that code.

        You need complete rows and columns. And you have an openning table tag in the middle with no closure. I am not sure what kind of menu you want, so I don't know what that code should be.

        Comment

        • tril0Byte
          Member
          • Oct 2001
          • 72
          • 3.0.6

          #5
          Originally posted by Jake Bunce
          I see funky HTML in your source:


          I assume the red code is the collapsable menu. No doubt FF is choking on that code.

          You need complete rows and columns. And you have an openning table tag in the middle with no closure. I am not sure what kind of menu you want, so I don't know what that code should be.
          I think you may be right about the crappy html. I'm really not that good at it (funky is being polite - thankyou for that, you could have been much harder on me ), but tables are closed in the footer, wrapping the whole forum - it's commented out there.
          BritishBlades :: Cutsom Knives

          Comment

          • Jake Bunce
            Senior Member
            • Dec 2000
            • 46598
            • 3.6.x

            #6
            For testing purposes, try removing the current collapsable element. Then add a simple collapsable div in your header or something:

            Code:
            <div id="collapseobj_sidebar" style="$vbcollapse[collapseobj_sidebar]">
            
            COLLAPSED STUFF
            
            </div>
            See if that collapses when you click the button.

            Comment

            • tril0Byte
              Member
              • Oct 2001
              • 72
              • 3.0.6

              #7
              In my forumhome template I have this at the top:

              Code:
              $header
              [color=red]<!-- Sidebar -->[/color]
              [color=red]<table width="$stylevar[tablewidth]" cellpadding="6" cellspacing="0" border="0">[/color]
              [color=red]<tr>[/color]
              [color=red]<td style="width:150px" id="collapseobj_sidebar" style="{$GLOBALS['vbcollapse']['collapseobj_sidebar']}" valign="top">$sidebar</td>[/color]
              [color=red]<td valign="top">[/color]
              [color=red]<!-- Update -->[/color]
              [color=red]<table width="$stylevar[tablewidth]" cellpadding="0" cellspacing="0" border="0">[/color]
              [color=red]<tr>[/color]
              [color=red]		<td style="width:100%"></td>[/color]
              [color=red]<!-- /Update -->[/color]
              [color=red]<!-- /Sidebar -->[/color]
              $navbar

              ...and this at the bottom:

              Code:
              <!-- /main -->
              <br />
              <br />
              [color=red]<!-- Sidebar -->[/color]
              [color=red]<!-- Update -->[/color]
              [color=red]</td>[/color]
              [color=red]</tr>[/color]
              [color=red]</table>[/color]
              [color=red]<!-- /Update -->[/color]
              [color=red]</td>[/color]
              [color=red]</tr>[/color]
              [color=red]</table>[/color]
              [color=red]<!-- /Sidebar -->[/color]
              <!-- what's going on box -->
              BritishBlades :: Cutsom Knives

              Comment

              • Jake Bunce
                Senior Member
                • Dec 2000
                • 46598
                • 3.6.x

                #8
                What does $sidebar evaluate to?

                Comment

                • tril0Byte
                  Member
                  • Oct 2001
                  • 72
                  • 3.0.6

                  #9
                  Originally posted by Jake Bunce
                  What does $sidebar evaluate to?
                  The content template, hang on...
                  BritishBlades :: Cutsom Knives

                  Comment

                  • tril0Byte
                    Member
                    • Oct 2001
                    • 72
                    • 3.0.6

                    #10
                    Arggghhhhhhhh - I cant believe I've done this, I've just wiped the content of my template.
                    BritishBlades :: Cutsom Knives

                    Comment

                    • tril0Byte
                      Member
                      • Oct 2001
                      • 72
                      • 3.0.6

                      #11
                      OK, got it back - whew!

                      The $sidebar evaluates to...

                      Code:
                      <!-- sidebar content -->
                      <table cellpadding="0" cellspacing="0" border="0" class="tborder" width="170" align="center">
                      </table>
                      <!-- navigation block -->
                      <table  border="0" cellpadding="6" cellspacing="1" class="tborder" width="170">
                        <tr>
                        <td class="tcat"><span class="smallfont"><b>» Navigation</b></span></td>
                       </tr>
                       <tr>
                        <td class="alt1">
                      	  <div class="buttonscontainer">
                      	  <div class="buttons">
                      <a href="[url="http://www.britishblades.com/home/index.php?action=news&catid=1"]http://www.britishblades.com/home/index.php?action=news&catid=1[/url]" class="buttons">Website Home</a>
                      <a href="[url="http://www.britishblades.com/forums/"]http://www.britishblades.com/forums/[/url]" class="buttons">Forums Home</a>
                      <a href="[url="http://www.britishblades.com/photopost/"]http://www.britishblades.com/photopost/[/url]" class="buttons">Gallery Home</a>
                      <a href="[url="http://www.britishblades.com/home/modules.php?modname=custompage&name=bookshop"]http://www.britishblades.com/home/modules.php?modname=custompage&name=bookshop[/url]"> Bookshop</a>
                      <a href="[url="http://www.britishblades.com/auctions/"]http://www.britishblades.com/auctions/[/url]" class"buttons">Auctions</a>
                      <a href="javascript:n_window('http://www.britishblades.com/forums/bbchat/chat/popupchat.php');" class="buttons">Chatroom</a>
                      <a href="[email="[email protected]"]mailto:[email protected][/email]" class="buttons">Contact Us</a>
                      	  </div>
                      	  </div
                      </td>
                       </tr>
                      </table>
                      <!-- /navigation block -->
                      <div style="padding: 5px 5px 5px 5px;"></div>  
                      <!-- Search Block -->
                       
                      <form action="[url="http://www.britishblades.com/forums/search.php"]http://www.britishblades.com/forums/search.php[/url]" method="post" name="search">
                      <table  border="0" cellpadding="6" cellspacing="1" class="tborder"  width="170">
                        <tr>
                       
                         <td class="tcat"><span class="smallfont"><strong> » Search Forums</strong></span></td>
                        </tr>
                        <tr>
                         <td class="alt1">
                         <input name="s" type="hidden" value="" />
                         <input name="do" type="hidden" value="process" />
                         <input name="sortby" type="hidden" value="lastpost" />
                         <input name="forumchoice" type="hidden" value="0" />
                         <input class="bginput" name="query" size="14" type="text" /> <!-- go button -->
                      <input type="submit" class="button" value="Go"  />
                         </td>
                        </tr>
                      <tr>
                         <td class="tcat"><span class="smallfont"><b>» Other Search Options</b></span></td>
                        </tr>
                        <tr>
                         <td class="alt1">
                      <div class="buttonscontainer">
                      <div class="buttons">
                      <a href="search.php?" class="buttons">Advanced Search</a>
                      <a href="search.php?do=getnew" class="buttons">Find New Posts</a>
                      <a href="search.php?do=getdaily" class="buttons">Find Today's Posts</a>
                      <a href="memberlist.php?do=search" class="buttons">Members Search</a>
                      </div>
                      </div>
                        </tr>
                       </table>
                      </form>
                      <!-- End Search Block -->
                      <div style="padding: 5px 5px 5px 5px;"></div>
                      <!-- ofsitemenu block -->
                      <table  border="0" cellpadding="6" cellspacing="1" class="tborder"  width="170">
                        <tr>
                       
                         <td class="tcat"><span class="smallfont"><strong> » General Articles</strong></span></td>
                        </tr>
                        <tr>
                         <td class="alt1">
                      <div class="buttonscontainer">
                      <div class="buttons">
                      <a href="<A href="http://www.britishblades.com/home/articles.php?action=cat&acid=9">Tutorials">http://www.britishblades.com/home/articles.php?action=cat&acid=9">Tutorials & Howto's</a>
                      <a href="<A href="http://www.britishblades.com/home/articles.php?action=cat&acid=1">Sharps">http://www.britishblades.com/home/articles.php?action=cat&acid=1">Sharps Articles</a>
                      <a href="<A href="http://www.britishblades.com/home/articles.php?action=cat&acid=8">Gear">http://www.britishblades.com/home/articles.php?action=cat&acid=8">Gear Articles</a>
                      </div>
                      </div>
                         </td>
                        </tr>
                      <tr>
                         <td class="tcat"><span class="smallfont"><b>» Reviews</b></span></td>
                        </tr>
                        <tr>
                         <td class="alt1">
                      <div class="buttonscontainer">
                      <div class="buttons">
                      <a href="<A href="http://www.britishblades.com/home/articles.php?action=cat&acid=2">Custom">http://www.britishblades.com/home/articles.php?action=cat&acid=2">Custom Fixed Blades</a>
                      <a href="<A href="http://www.britishblades.com/home/articles.php?action=cat&acid=3">Custom">http://www.britishblades.com/home/articles.php?action=cat&acid=3">Custom Folders</a>
                      <a href="<A href="http://www.britishblades.com/home/articles.php?action=cat&acid=7">Prod">http://www.britishblades.com/home/articles.php?action=cat&acid=7">Prod. Fixed Blades</a>
                      <a href="<A href="http://www.britishblades.com/home/articles.php?action=cat&acid=4">Production">http://www.britishblades.com/home/articles.php?action=cat&acid=4">Production Folders</a>
                      <a href="<A href="http://www.britishblades.com/home/articles.php?action=cat&acid=5">Other">http://www.britishblades.com/home/articles.php?action=cat&acid=5">Other Sharps</a>
                      <a href="<A href="http://www.britishblades.com/home/articles.php?action=cat&acid=6">Brights">http://www.britishblades.com/home/articles.php?action=cat&acid=6">Brights & Gear</a>
                      </div>
                      </div>
                        </tr>
                       </table>
                      <!-- /ofsitemenu block --> </td>
                      <!-- /sidebar content -->
                      BritishBlades :: Cutsom Knives

                      Comment

                      • tril0Byte
                        Member
                        • Oct 2001
                        • 72
                        • 3.0.6

                        #12
                        Originally posted by Jake Bunce
                        For testing purposes, try removing the current collapsable element. Then add a simple collapsable div in your header or something:


                        See if that collapses when you click the button.
                        Done (you can see it now) and it works in Firefox.

                        It's definitely my funky html, thankyou for your help Jake (sorry for wasting your time), i'll go read html for dummies.
                        Last edited by tril0Byte; Mon 21 Mar '05, 9:06am.
                        BritishBlades :: Cutsom Knives

                        Comment

                        • Jake Bunce
                          Senior Member
                          • Dec 2000
                          • 46598
                          • 3.6.x

                          #13
                          Ah ok.

                          I can't immediately see the solution. Maybe try reverting some pieces of your style and build up from there.

                          Comment

                          • tril0Byte
                            Member
                            • Oct 2001
                            • 72
                            • 3.0.6

                            #14
                            Originally posted by Jake Bunce
                            Ah ok.

                            I can't immediately see the solution. Maybe try reverting some pieces of your style and build up from there.
                            Thanks again. I'll start from scratch with the sidebar html. At least now I know the collapse elements work, so I can effectively leave those in place, and my problem seems to be basic html - I just need to figure out the html and tables. Thanks.
                            BritishBlades :: Cutsom Knives

                            Comment

                            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                            Working...