Results 1 to 5 of 5

Thread: Working with CBox Tagboard, and trying to Toggle AutoRefresh

  1. #1
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Working with CBox Tagboard, and trying to Toggle AutoRefresh

    <script>function toggle(cboxmain){

    var element = document.getElementById(cboxmain);

    element.style.display = (element.style.display == 'block') ? "none" : "block";

    }

    </script>

    <!-- BEGIN CBOX - www.cbox.ws - v001 -->
    <div id="cboxdiv" style="text-align: center; line-height: 0">
    <div>
    <script type=text/javascript>
    function refresh()
    {
    document.all.cboxmain.src = document.all.cboxmain.src;
    }
    window.setInterval("refresh()",7500);
    </script>
    <iframe name='cboxmain' frameborder="0" width="300" height="100" src="http://www5.cbox.ws/box/?boxid=407802&boxtag=7124&sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#FFFFFF 1px solid;" id="cboxmain"></iframe><script>
    </script></div>
    <div><iframe frameborder="0" width="300" height="75" src="http://www5.cbox.ws/box/?boxid=407802&boxtag=7124&sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#FFFFFF 1px solid;border-top:0px" id="cboxform"></iframe></div>
    </div>
    <!-- END CBOX --><script type="text/javascript">
    function popcbox() {
    cboxwin = window.open("","Cbox","width=200,height=515,toolbar=no,scrollbars=no,status=no,resizable=yes");
    cboxwin.document.write('<html><head><title>Cbox</title></head><frameset rows="*,75" frameborder="0" framespacing="0">');
    cboxwin.document.write('<frame marginwidth="2" marginheight="2" src="http://www5.cbox.ws/box/?boxid=407802&boxtag=7124&sec=main" noresize="true" scrolling="auto" name="cboxmain" style="border:#FFFFFF 1px solid;"/>');
    cboxwin.document.write('<frame marginwidth="2" marginheight="2" src="http://www5.cbox.ws/box/?boxid=407802&boxtag=7124&sec=form" noresize="true" scrolling="no" name="cboxform" style="border:#FFFFFF 1px solid;border-top:0px"/></frameset>'); cboxwin.document.write('<noframes>Cbox needs frames!</noframes></html>');
    try {
    x = screen.width;
    y = screen.height;
    cboxwin.moveTo(Math.max((x/2)-150, 0), Math.max((y/3)-88));
    } catch (e) {};
    }
    </script>
    <Center><a href="JavaScript: popcbox();">Click for Shoutbox Window</a>|<a href="javascript: toggle('refresh');">Toggle Refresh</a></Center>

    I can't get it to Toggle the Auto-Refreshing? How can I fix this?

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Okay- buggy code there, but anyway:

    It won't work cuz you don't have an element with the id of 'refresh'.

    Please post a link to the page on your site that contains the problematic script so we can check it out. This helps us help you.

    -magicyte

  3. #3
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sure. No making fun though, I have my childish moments like anyone else.

    http://Y3KUniverse.Proboards.com

    - Warning, due to problems, the code is loading slow right now. Scrubbing it in pieces as we speak, so...yeah.

    Edit: Actually, it's server side. So my code is fine, besides the lack of being able to toggle the reloading script.

    Updated code (Still not working) - By the way, if it's something really stupid, I apologize, I don't know JavaScript well at all.

    -------------------------------------
    Code:
    </script>
     <script>function toggle(id){ 
    
      var element = document.getElementById(id); 
    
      element.style.display = (element.style.display == 'block') ? "none" : "block"; 
    
      } 
    
     </script> 
    <tr><td width="43.5%" valign="top" class="windowbg">
    <!-- BEGIN CBOX - www.cbox.ws - v001 --> 
    <div id="cboxdiv" style="text-align: center; line-height: 0"> 
    <div>
    <div  id="refresh" style="display:block"><script type=text/javascript>
       function refresh()
       {
         document.all.cboxmain.src = document.all.cboxmain.src;
       }
       window.setInterval("refresh()",7500);
    </script></div>
    <iframe name='cboxmain' frameborder="0" width="300" height="100" src="http://www5.cbox.ws/box/?boxid=407802&boxtag=7124&sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#FFFFFF 1px solid;" id="cboxmain"></iframe><script>
    </script></div> 
    <div><iframe frameborder="0" width="300" height="75" src="http://www5.cbox.ws/box/?boxid=407802&boxtag=7124&sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#FFFFFF 1px solid;border-top:0px" id="cboxform"></iframe></div> 
    </div> 
    <!-- END CBOX -->
    <script type="text/javascript">
    |<a href="javascript:  toggle(id);">Test Refresh</a></Center>
    Note: This isn't all the code, the tables and stuff specific to the site have been stripped. If you need those, please let me know.
    Last edited by HelpWanted; 01-19-2009 at 09:08 PM.

  4. #4
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have to ask...did I not give something I was supposed to about the code? I'm curious as to why I'm getting virtually no responses...

  5. #5
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by HelpWanted View Post
    Sure. No making fun though, I have my childish moments like anyone else.

    http://Y3KUniverse.Proboards.com

    - Warning, due to problems, the code is loading slow right now. Scrubbing it in pieces as we speak, so...yeah.

    Edit: Actually, it's server side. So my code is fine, besides the lack of being able to toggle the reloading script.

    Updated code (Still not working) - By the way, if it's something really stupid, I apologize, I don't know JavaScript well at all.

    -------------------------------------
    Code:
    </script>
     <script>function toggle(id){ 
    
      var element = document.getElementById(id); 
    
      element.style.display = (element.style.display == 'block') ? "none" : "block"; 
    
      } 
    
     </script> 
    <tr><td width="43.5%" valign="top" class="windowbg">
    <!-- BEGIN CBOX - www.cbox.ws - v001 --> 
    <div id="cboxdiv" style="text-align: center; line-height: 0"> 
    <div>
    <div  id="refresh" style="display:block"><script type=text/javascript>
       function refresh()
       {
         document.all.cboxmain.src = document.all.cboxmain.src;
       }
       window.setInterval("refresh()",7500);
    </script></div>
    <iframe name='cboxmain' frameborder="0" width="300" height="100" src="http://www5.cbox.ws/box/?boxid=407802&boxtag=7124&sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#FFFFFF 1px solid;" id="cboxmain"></iframe><script>
    </script></div> 
    <div><iframe frameborder="0" width="300" height="75" src="http://www5.cbox.ws/box/?boxid=407802&boxtag=7124&sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#FFFFFF 1px solid;border-top:0px" id="cboxform"></iframe></div> 
    </div> 
    <!-- END CBOX -->
    <script type="text/javascript">
    |<a href="javascript:  toggle(id);">Test Refresh</a></Center>
    Note: This isn't all the code, the tables and stuff specific to the site have been stripped. If you need those, please let me know.
    hi can u give me all the codes? wonder if u know how to write script for auto tagging?

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
  •