Web Design Forums

Welcome! Please register or log in: Forgot your password? Why register?
You are here: Web Design Forums » Programming Help » PHP » php css RSS

php css

This thread was started by Dorky and has been viewed 641 times, and contains 4 replies, with the last reply made by Dorky.
Post Reply
1
34 points at 74%
Dorky, Freelance Home page   Private message  
Posted June 26 '09 at 01:33 AM
      Posts: 782
hey just having fun, thought it would be cool to have a animated effect using php. like some steel doors opening
(im sure youve seen this before) by using the statement below to be used in a css position parameter. i have tried but fail to change the variable out in the same position, only echoing the full count or outside the loop it gives just the final. also failing to properly integrate the variable in the css. any thoughts ?

<?php
$num 
= -950 ; while($num ) { usleep(200); ++$num; echo $num; }
?>
<style>
#door { position: absolute; left: <?php echo $num; ?>px; }
</style>
“Imagination is more important than knowledge. For knowledge is limited to all we now know and understand, while imagination embraces the entire world, and all there ever will be to know and understand.” Albert Einstein

Advertisement Register for free to hide these ads and participate in discussions!

2
58 points at 100%
imagn, WDF Addict! Home page   Private message  
Posted June 26 '09 at 04:47 AM
      Posts: 156
I see what you're trying to do and would recommend you look into JavaScript to pull this off - more specifically the jQuery library.

http://docs.jquery.com/Main_Page

3
34 points at 74%
Dorky, Freelance Home page   Private message  
Posted June 26 '09 at 02:18 PM
      Posts: 782
lol i knew i would be told this. i was just giving it a try. i dont think the browser will render changing css so this is a dead project. but i have been up on css3 and with any luck it will be set in stone sooner then later. animations will be part of css3 and apple is actually at the forfront of this. very cool stuff.
“Imagination is more important than knowledge. For knowledge is limited to all we now know and understand, while imagination embraces the entire world, and all there ever will be to know and understand.” Albert Einstein

4
32 points at 100%
Posted July 1 '09 at 04:35 AM
      Posts: 76
I see what you're trying to do and would recommend you look into JavaScript to pull this off - more specifically the jQuery library.

http://docs.jquery.com/Main_Page

He is right, PHP renders a dynamic page, but once it is rendered it does nothing more. Using JQuery, you can have it auto-refresh the content without reloading the page itself -- just a component of that page which you can make more dynamic with PHP. But it is impossible to make the page itself "dynamic" in the sense of animations without reloads.
Lead Web Designer
MLW & Associates, LLP.
W3C Standards Complaint and SEO Friendly
Admin of Vraul

5
34 points at 74%
Dorky, Freelance Home page   Private message  
Posted July 1 '09 at 05:53 AM
      Posts: 782
thx for the expanded explanation Danny. i think i could do it if i could fig out how to set and unset in quick succession using usleep or the other i cant remember off the top of my head for milliseconds. echoing a div in a loop. but so far i cannot get the int to replace the previous, only in seq like 123456 instead of 1 then 2 then 3 replaceing the lower with the higher.
“Imagination is more important than knowledge. For knowledge is limited to all we now know and understand, while imagination embraces the entire world, and all there ever will be to know and understand.” Albert Einstein

Post Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Top 21 PHP Programming mistakes thexchord PHP 18 March 10 '10 09:52 AM
So HTML + CSS, Now PHP or javascipt? 12ecruit General Design Discussion 31 September 12 '08 01:11 AM
how to add css to php code ketanco PHP 5 March 30 '08 03:29 AM
CSS + IE + php includes maybe = woes!! minger HTML and CSS Help 12 September 4 '07 04:58 PM
CSS and PHP spasm attack Web Design Discussion 2 August 22 '06 11:26 PM