|
Tutorial: - Adding Something To the top/bottom of your PB Forum
I will explain this whole tutorial by using one of the Codes I've made for Proboardsv4
First we ad a div with an id to the header/footer(We will use this to help us place what we want where we want header[if u want it at the top] or footer[if you want it at the bottom of your board])
<div id='InfoCenter'> </div>
So you see? Now you close the div and thats it for this part!
<script type="text/javascript"> <!--
we start the script... Now we grab a table and then loop it...
Table = document.getElementsByTagName('Table'); for(i=0;i<Table.length;i++){
You should have something like that now. Now we match to the table(or something else depending on what you want) of the info center:
if(Table[i].className=="bordercolor" && Table[i].innerHTML.match(/Info Center/i)){
So we've matched to the info center! Now we save the info center table by putting its innerHTML value in a variable like this:
var iCenter = Table[i].innerHTML;
Now we remove the thing that were moving(or you could keep it there...your choice) by hiding/deleting it:
Table[i].style.display='none'
Now its hidden. Finally this is where the div id comes in...We grab the Id and make the innerHTML of the id our variable that was holding the info center:
document.getElementById('InfoCenter').innerHTML = iCenter;
now we end the script
//--> </script>
and there you have it
|
|
|
|
|
Does the
<div id='InfoCenter'> </div>
part have to go above the <script type="text/javascript">?
|
|
|
|
Yep. Otherwise, its not there when the script executes, now is it?
|
|
|
|
|
Well, couldn't you use:
document.write("<div id='InfoCenter'></div>");
?
|
|
|
|
|
I saw that in one of California's codes so I think you can.
|
|
|
|
|
Wow, that really cleared up a lot of things for me.
|
|
|
|
Well, couldn't you use: document.write("<div id='InfoCenter'></div>"); ? Yeah but the only good that'd do is prevent the DIV from printing when JS is disabled.
|
|
|
|
Which is a good thing if you don't want a useless DIV on the page
|
|
|
|
Which is a good thing if you don't want a useless DIV on the page Exactly as I said. There are other ways though, not that i'd recommend them... <noscript> <style type="text/css"> #InfoCenter { display: none } </style> </noscript> <div id="InfoCenter"></div>
|
|
|
|
Just a question. How do we know the id of the thing we're moving?
|
|
|
|
Just a question. How do we know the id of the thing we're moving? Well, in this example, there is no ID for what you're moving. The ID is assigned to WHERE it is being moved. To find the ID of something (only if it already has an ID) can be done by find the ID attribute of the tag... <div id="infocenter"></div> There, the id is "infocenter"
|
|
|
|
|
yes, but like how do you find out the item's id. I know info center is infocenter.
|
|
|
|
Sounds to me like you don't know quite enough to make use of this tutorial. You may want to learn a bit about web programming in general first. From there pick up on HTML and JavaScript as those are the languages that give this tutorial any meaning. And if you really don't want to get into that, again, this tut is aimed towards people that are learning the languages and need some tips and tricks on how to achieve certain goals. I recommend in such a case that you make a code request (if you can't find what you need in a database).
Last Edit: Jul 6, 2008 22:27:31 GMT by Aaron
|
|
|
|
^ Maybe he meant proboards ID's. I don't know of any FAQ that tells you of them all. Most people just know them, but other don't.
That would make a good guide. All the ID's and stuff you could use in a proboard compatible code.
|
|
|
|
|
^ Maybe he meant proboards ID's. I don't know of any FAQ that tells you of them all. Most people just know them, but other don't. That would make a good guide. All the ID's and stuff you could use in a proboard compatible code. The only one I know of is "forumjump" There are no IDs... well, til v5 hits. superkid: That id does not deal with the info center at all. Sasuke could have made it "ZOMGWTFBBQSAUCE" and it wouldn't have mattered as long as it was the same ID for both the tag and the code. The ID itself is arbitrary. It doesn't grab the info center for your manipulation. The looping (the for's and the if's) grabbed the info center. His example MOVED the info center to the div that he gave the ID to.
|
|
|
|