Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style style="text/css">
- .scroll-up {
- height: 500px;
- width: 400px;
- overflow: hidden;
- position: relative;
- background: yellow;
- color: black;
- border: 1px solid black;
- }
- .scroll-up p {
- position: absolute;
- width: 400px;
- padding-right: 100%;
- height: 100%;
- margin: 0;
- line-height: 50px;
- text-align: center;
- /* Starting position */
- -moz-transform:translateY(100%);
- -webkit-transform:translateY(100%);
- transform:translateY(100%);
- /* Apply animation to this element */
- -moz-animation: scroll-up 20s linear infinite;
- -webkit-animation: scroll-up 20s linear infinite;
- animation: scroll-up 20s linear infinite;
- }
- .clones_wrapper {
- height: 500px;
- width: 400px;
- overflow: hidden;
- position: relative;
- background: yellow;
- color: black;
- border: 1px solid black;
- }
- /* Move it (define the animation) */
- @-moz-keyframes scroll-up {
- 0% { -moz-transform: translateY(100%); }
- 100% { -moz-transform: translateY(-100%); }
- }
- @-webkit-keyframes scroll-up {
- 0% { -webkit-transform: translateY(100%); }
- 100% { -webkit-transform: translateY(-100%); }
- }
- @keyframes scroll-up {
- 0% {
- -moz-transform: translateY(100%); /* Browser bug fix */
- -webkit-transform: translateY(100%); /* Browser bug fix */
- transform: translateY(100%);
- }
- 100% {
- -moz-transform: translateY(-100%); /* Browser bug fix */
- -webkit-transform: translateY(-100%); /* Browser bug fix */
- transform: translateY(-100%);
- }
- }
- </style>
- <div class="clones_wrapper">
- <h2 align='center'>Clones</h2>
- <table style = width:400px;><tr><th>Strain</th><th>Type</th><th>Rating</th><th>Price</th></tr></table>
- <div class="scroll-up">
- <p><?php
- echo "<table>";
- echo "<marquee behavior='scroll', direction='up'></marquee>";
- class TableRows extends RecursiveIteratorIterator {
- function __construct($it) {
- parent::__construct($it, self::LEAVES_ONLY);
- }
- function current() {
- return "<td align='center' style='width:150px;'>" . parent::current(). "</td>";
- }
- function beginChildren() {
- echo "<tr>";
- }
- function endChildren() {
- echo "</tr>" . "n";
- }
- }
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "clonemenudb";
- try {
- $conn = new PDO("mysql:host=$servername;dbname=clonemenudb", $username, $password);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $stmt = $conn->prepare("SELECT strain, type, imagefile, price FROM clones_db");
- $stmt->execute();
- // set the resulting array to associative
- $result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
- foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v) {
- echo $v;
- }
- }
- catch(PDOException $e) {
- echo "Error: " . $e->getMessage();
- }
- $conn = null;
- echo "</table>";
- ?>
- </p>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement