Friday, July 12, 2013

Marquee style in different manner with PHP and MySql

Marquee style scroll using in different manner, such as top to bottom, bottom to top, left to right, right to left, and scroll speed control, like all those details we are going to discuss here. usually all web developer must this tag that is marquee tag, which this marquee tag is used for the purpose of make the small kind of head line or make important thing in the particular area using marquee scroll style, similarly here we are going to discuss the thing about marquee tag with Php and Mysql.


DOWNLOAD           LIVE DEMO

marquee tag is used for more purpose, like top news publishing with marquee scrolling and more frequently publishing news or some other all things are scroll in a particular area, for that here we are using the marquee tag.

STOP / START

Marquee start and stop is the one main function most of us searching this thing, how is it happens on mouse hover. see the code.

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

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

MARQUEE DIRECTION 

Marquee direction is for make the marquee move direction, the moving of marquee tag is move towards to which direction, like left to right, or right to left like that. for that we are using that marquee direction tag. see the code.

<marquee behavior="scroll" direction="right/left/up/down" onmouseover="this.stop();" onmouseout="this.start();">
</marquee>

choose any one direction in the above direction like left or right or up or down any one direction.

MARQUEE SPEED

Marquee  speed how reduce and increase 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 increase the value of scrollamount the speed will be increased, when you are reducing the scrollamount the speed 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>


5 comments:

  1. Nice!! Thank you very much!!

    ReplyDelete
  2. Dude your like century away :D

    ReplyDelete
  3. Many Many Thanks to you. It was wanted by me from many days ago. Really I become very happy to get it. May Allah bless You.

    ReplyDelete
  4. Thanks and keep up the good work visit: http://www.dreamdestinations.in/

    ReplyDelete