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.

Moving output to divs

Postby Epiales » Sat Oct 11, 2014 1:16 pm

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: Wed Aug 14, 2013 8:38 pm
Has thanked: 62 times
Been thanked: 6 times

Re: Moving output to divs

Postby Epiales » Sat Oct 11, 2014 1:19 pm

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: Wed Aug 14, 2013 8:38 pm
Has thanked: 62 times
Been thanked: 6 times

Re: Moving output to divs

Postby Epiales » Sat Oct 11, 2014 1:32 pm

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: Wed Aug 14, 2013 8:38 pm
Has thanked: 62 times
Been thanked: 6 times

Re: Moving output to divs

Postby Epiales » Sat Oct 11, 2014 2:50 pm

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
User avatar
Epiales
 
Posts: 1119
Joined: Wed Aug 14, 2013 8:38 pm
Has thanked: 62 times
Been thanked: 6 times


Return to Beginner Help and Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron

x