PDA

View Full Version : Working with CBox Tagboard, and trying to Toggle AutoRefresh



HelpWanted
01-19-2009, 05:13 AM
<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?

magicyte
01-19-2009, 04:17 PM
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

HelpWanted
01-19-2009, 08:52 PM
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.

-------------------------------------


</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.

HelpWanted
01-21-2009, 02:02 AM
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...

xln
05-19-2009, 04:33 AM
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.

-------------------------------------


</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?