Moving output to divs

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Moving output to divs

Post by Epiales »

Okay, I'm querying my battle system, and I want to be able to output the results to a div that is at the bottom of the page. I know I could probably css this, but isn't there an easier way? Just too much to tell the css to go this far down and that far over for a div, when the output will be different, based upon what the player uses to attack with. So making a div at the bottom of the page and then having the ouput go into that div would be best for me I think. I may figure this out before anyone replies, but if you have an idea, please share lol. tankies :mrgreen:
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: Moving output to divs

Post by Epiales »

Okay, I just made an output equals variable then echoed the variables in that output, and then in the div, I just outputted the ouput variable lmao. I think that's gonna work. YAY.
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: Moving output to divs

Post by Epiales »

Okay, to go along with this... I would like to display a progress bar and then some more text, and then a progress bar and them more text.

I tried using PAUSE feature in php but that starts the pause upon the page load and doesn't work properly.

So I need a work around if at all possible.
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: Moving output to divs

Post by Epiales »

Okay, I created a function to do the message, but how do I do more than one message? It echo's the loss of health, but I want it to wait like 5 seconds and then display the loss of strength or something else?

here is my code:

Code: Select all

<script type="text/javascript">

setInterval  ( "bulletattack()", 5000 );

function bulletattack ( )
{
  document.getElementById("lose_bullets").innerHTML = "<?php echo $outputList; ?>";
}

</script>
<div id="lose_bullets" style="height: 1.5em; font-size: 2em; color: red;">
</div>
Nothing fancy, but a work in progress!

http://gameplaytoday.net
Post Reply

Return to “Beginner Help and Support”