Friday, 18 July 2014

Marquee style in different manner with PHP and MySql

Marquee style parchment utilizing as a part of distinctive way, for example, through and through, bottom to top, left to right, right to left, and parchment velocity control, in the same way as each one of those points of interest we are going to examine here. normally all web engineer should this label that is marquee tag, which this marquee tag is utilized with the end goal of make the little sort of head line or make critical thing in the specific territory utilizing marquee parchment style, comparably here we are going to talk about the thing about marquee tag with php and Mysql.
marquee tag is utilized for more reason, in the same way as top news distributed with marquee scrolling and all the more often distributed news or some other everything is span in a specific territory, for that here we are utilizing the marquee tag.

STOP / START

Marquee start and stop is the one fundamental capacity a large portion of us looking this thing, how is it happens on mouse float. see the code.

<marquee behavior="scroll" onmouseover="this.stop();" onmouseout="this.start();">
</marquee>

onmouseover="this.stop();" for stop the marquee content on mouse over,onmouseout="this.start();" for start the marquee tag satisfied on mouse out.

MARQUEE DIRECTION 

Marquee direction is for make the marquee move heading, the moving of marquee tag is move towards to which course, in the same way as left to right, or right to left like that. For that we are utilizing that marquee direction tag. See the code.
<marquee behavior="scroll" direction="right/left/up/down" onmouseover="this.stop();" onmouseout="this.start();">
</marquee>

Pick any one course in the above bearing like left or right or up or down any one heading.

MARQUEE SPEED

Marquee speed how reduces and add to the speed of marquee tag moving. See the code.
<marquee behavior="scroll" scrollamount="5" direction="right" onmouseover="this.stop();" onmouseout="this.start();">
</marquee>

that is scrollamount="5" we can give any number value for that, when you expand the quality of scrollamount the velocity will be expanded, when you are decreasing the scrollamount the rate will be decreased.

PHP and Mysql FETCH FROM DATABASE

<?php
$con=mysql_connect('localhost','root','');
$db=mysql_select_db('2my4edge',$con);
?>

Database name --> 2my4edge
table name --> marquee
column names --> id, feeds
<div class="main">
      <?php
       $fetch=mysql_query("select * from marquee limit 5");
       if(mysql_num_rows($fetch))
          {
      ?>
    <marquee behavior="scroll" scrollamount="2" direction="up" onmouseover="this.stop();" onmouseout="this.start();">
       <ul class="ulclass" >
             <?php 
                while($row=mysql_fetch_array($fetch))
                 {
                 $id=$row['id'];
                 $feed=$row['feeds'];
               ?>
           <li class="liclass">
                 <?php echo $feed;  ?>  
                 <?php }  ?>
            </li>
                 <?php }  ?>  
      </ul>
               
              </marquee>
</div>


You can clear with the above coding, simply fetch data from the database, which is from marquee table, *astrick is for select the entire field from the table name. Also make the coding with simple.

No comments:

Post a Comment