11.07.2015 Views

AJAX and PHP

AJAX and PHP

AJAX and PHP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6Figure 6.4: <strong>PHP</strong> Documentation for strstrWhat Just Happened?Let us start with the index.html file.The interesting part in this script is that a scroll region can be implemented in DHTML. A littlepiece of heaven regarding scrolling can be found at http://www.dyn-web.com/dhtml/scroll/.The idea for having a part of the page with a scrollbar next to it is to have two layers one insideanother. In our example the div scroll <strong>and</strong> the div suggest do the trick.The outer layer is scroll. It has a fixed width <strong>and</strong> height <strong>and</strong> its most useful property isoverflow. Generally, the content of a block box is confined to just the content edges of the box.In certain cases, a box may overflow, meaning that part of its content lies outside the box. In CSS,the overflow property specifies what happens when an element overflows its area. You can findthe possible values of overflow at http://www.w3.org/TR/REC-CSS2/visufx.html.Another thing that can be interesting is how we can center an object horizontally. The classic align= center attribute is not valid in XHTML 1.0 <strong>and</strong> therefore a workaround needs to be found. Thesolution is to use the margin attribute set to auto for the element you want centered. If you have avalid doctype, Internet Explorer 6 will render an element having auto margins centered; otherwise,as is the case with the earlier versions, the attribute will be ignored. For earlier versions of InternetExplorer, you need to have the text-align attribute set to center for the parent of the element you183

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!