ผมวนได้แต่รูปใหญ่ แต่รูปที่เป็น index ในการเลือกรูปภาพนั้นยังระบุตำแหน่งไม่ได้ครับ รบกวนหน่อยครับ
โค๊ดนะครับ
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LofCoolFlashNews 1.0 - Mootool 1.2</title>
<link rel="stylesheet" type="text/css" href="css/layout.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script language="javascript" type="text/javascript" src="js/mootools-1.2.1-core.js"></script>
<script language="javascript" type="text/javascript" src="js/mootools-1.2-more.js"></script>
<script language="javascript" type="text/javascript" src="js/lofslidernews.mt12.js"></script>
</head>
<body>
<div id="container">
<h1><strong>LofCoolFlashNews 1.0</strong> - Slideshow - Mootool 1.2</h1>
<p>
<strong> Direction: Left to Righ - Navitagor on the left side .</strong>
The plugin allow to use the wheelup and wheeldown to previous|next item in the list
</p>
<!------------------------------------- THE CONTENT ------------------------------------------------->
<div id="lofslidecontent45" class="lof-slidecontent">
<div class="preload"><div></div></div>
<!-- MAIN CONTENT -->
<div class="lof-main-wapper">
<div class="lof-main-item">
<img src="images/791902news3.jpg" title="Newsflash 2" height="300" width="900">
<div class="lof-main-item-desc">
<h3><a target="_parent" title="Newsflash 2" href="#">Newsflash 2</a></h3>
<p>The one thing about a Web site, it always changes! Joomla! makes it easy to add Articles, content,...</p>
</div>
</div>
<div class="lof-main-item">
<img src="images/435576news10.jpg" title="Newsflash 1" height="300" width="900"> <div class="lof-main-item-desc">
<h3><a target="_parent" title="Newsflash 1" href="#">Newsflash 1</a></h3>
<p>Joomla! makes it easy to launch a Web site of any kind. Whether you want a brochure site or you are...</p>
</div>
</div>
<div class="lof-main-item">
<img src="images/641906img1.jpg" title="Newsflash 3" height="300" width="900"> <div class="lof-main-item-desc">
<h3><a target="_parent" title="Newsflash 3" href="#">Newsflash 3</a></h3>
<p>With a library of thousands of free Extensions, you can add what you need as your site grows. Don't...</p>
</div>
</div>
<div class="lof-main-item">
<img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc">
<h3><a target="_parent" title="Newsflash 5" href="#">Newsflash 5</a></h3>
<p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p>
</div>
</div>
<div class="lof-main-item">
<img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc">
<h3><a target="_parent" title="Newsflash 5" href="#">Newsflash 5</a></h3>
<p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p>
</div>
</div>
<div class="lof-main-item">
<img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc">
<h3><a target="_parent" title="Newsflash 5" href="#">Newsflash 5</a></h3>
<p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p>
</div>
</div>
</div>
<!-- END MAIN CONTENT -->
<!-- NAVIGATOR -->
<div class="lof-navigator-outer">
<ul class="lof-navigator">
<li>
<div>
<img src="images/lofthumbs/791902news3.jpg" />
<h3> NewsFlash 1 </h3>
<span>20.01.2010</span> - In id, mauris viverra asperiores, bibendum in id. Eu molestie. Ac sit eu...
</div>
</li>
<li>
<div>
<img src="images/lofthumbs/435576news10.jpg" />
<h3> NewsFlash 2 </h3>
<span>20.01.2010</span> -In id, mauris viverra asperiores, bibendum in id. Eu molestie. Ac sit eu. ..
</div>
</li>
<li>
<div>
<img src="images/lofthumbs/641906img1.jpg" />
<h3> NewsFlash 3 </h3>
<span>20.01.2010</span> - In id, mauris viverra asperiores, bibendum in id. Eu molestie. Ac sit eu. ..
</div>
</li>
<li>
<div>
<img src="images/lofthumbs/416719news7.jpg" />
<h3> NewsFlash 4</h3>
<span>20.01.2010</span> - In id, mauris viverra asperiores, bibendum in id. Eu molestie. Ac sit eu. ..
</div>
</li>
<li>
<div>
<img src="images/lofthumbs/641906img1.jpg" />
<h3> NewsFlash 5</h3>
<span>20.01.2010</span> -In id, mauris viverra asperiores, bibendum in id. Eu molestie. Ac sit eu. ..
</div>
</li>
<li>
<div>
<img src="images/lofthumbs/416719news7.jpg" />
<h3> NewsFlash 6</h3>
<span>20.01.2010</span> - In id, mauris viverra asperiores, bibendum in id. Eu molestie. Ac sit eu. ..
</div>
</li>
</ul>
</div>
</div>
<script type="text/javascript">
var _lofmain = $('lofslidecontent45');
var _lofscmain = _lofmain.getElement('.lof-main-wapper');
var _lofnavigator = _lofmain.getElement('.lof-navigator-outer .lof-navigator');
var object = new LofFlashContent( _lofscmain,
_lofnavigator,
_lofmain.getElement('.lof-navigator-outer'),
{ fxObject:{ transition:Fx.Transitions.Quad.easeInOut, duration:800},
interval:3000,
direction :'hrleft' } );
object.start( true, _lofmain.getElement('.preload') );
</script>
<!------------------------------------- END OF THE CONTENT ------------------------------------------------->
<p>
<a href="index.html">Demo 1</a> | <a href="index2.html">Demo 2</a> | <a href="index3.html">Demo 3</a> | <a href="index2.1.html">Demo with mootool 1.2</a> </p><br />
More script and css style
: <a href="http://www.htmldrive.net/" title="HTML DRIVE - Free DHMTL Scripts,Jquery plugins,Javascript,CSS,CSS3,Html5 Library">www.htmldrive.net </a>
</div>
</body>
</html>
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for tbl_test
-- ----------------------------
DROP TABLE IF EXISTS `tbl_test`;
CREATE TABLE `tbl_test` (
`id` int(11) NOT NULL auto_increment,
`image_name` text,
`image_link` text,
`image_detail` text,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of tbl_test
-- ----------------------------
INSERT INTO `tbl_test` VALUES ('1', 'Newsflash 1', '791902news3.jpg', 'The one thing about a Web site, it always changes! Joomla! makes it easy to add Articles, content,...');
INSERT INTO `tbl_test` VALUES ('2', 'Newsflash 2', '435576news10.jpg', 'Joomla! makes it easy to launch a Web site of any kind. Whether you want a brochure site or you are...');
INSERT INTO `tbl_test` VALUES ('3', 'Newsflash 3', '641906img1.jpg', 'With a library of thousands of free Extensions, you can add what you need as your site grows. Don\'t...');
INSERT INTO `tbl_test` VALUES ('4', 'Newsflash 4', '416719news7.jpg', 'Joomla! 1.5 - \'Experience the Freedom\'!. It has never been easier to create your own dynamic Web...');
หน้า index.php ครับ
Code (PHP)
<?php
$hostname_connection = "localhost";
$database_connection = "xxxxxx";
$username_connection = "root";
$password_connection = "";
$connection = mysql_pconnect($hostname_connection, $username_connection, $password_connection) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_query( "SET NAMES utf8" );
?>
<?php
mysql_select_db($database_connection, $connection);
$query = "SELECT * FROM tbl_test";
$rs_test = mysql_query($query, $connection) or die(mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LofCoolFlashNews 1.0 - Mootool 1.2</title>
<link rel="stylesheet" type="text/css" href="css/layout.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script language="javascript" type="text/javascript" src="js/mootools-1.2.1-core.js"></script>
<script language="javascript" type="text/javascript" src="js/mootools-1.2-more.js"></script>
<script language="javascript" type="text/javascript" src="js/lofslidernews.mt12.js"></script>
<font color="#FFFFFF"><?php echo $num; ?></font>
</head>
<body>
<div id="container">
<h1><strong>LofCoolFlashNews 1.0</strong> - Slideshow - Mootool 1.2</h1>
<p>
<strong> Direction: Left to Righ - Navitagor on the left side .</strong>
The plugin allow to use the wheelup and wheeldown to previous|next item in the list
</p>
<!------------------------------------- THE CONTENT ------------------------------------------------->
<div id="lofslidecontent45" class="lof-slidecontent">
<div class="preload"><div></div></div>
<!-- MAIN CONTENT -->
<div class="lof-main-wapper">
<?php $all = array(); ?>
<?php while($row_test = mysql_fetch_assoc($rs_test)) { ?>
<div class="lof-main-item">
<img src="images/<?php echo $row_test['image_link'];?>" title="Newsflash 2" height="300" width="900">
<div class="lof-main-item-desc">
<h3><a target="_parent" title="Newsflash 2" href="#"><?php echo $row_test['image_name'];?></a></h3>
<p><?php echo $row_test['image_detail'];?></p>
</div>
</div>
<?php $image_little = array('image_link'=>''.$row_test['image_link'].'', 'image_name'=>''.$row_test['image_name'].'', 'image_detail'=>''.$row_test['image_detail'].''); ?>
<?php array_push($all,$image_little); ?>
<?php } ?>
</div>
<!-- END MAIN CONTENT -->
<!-- NAVIGATOR -->
<div class="lof-navigator-outer">
<ul class="lof-navigator">
<?php foreach($all as $key => $value){ ?>
<li>
<div>
<img src="images/lofthumbs/<?php echo $value['image_link']; ?>" />
<h3> <?php echo $value['image_name']; ?> </h3>
<span>20.01.2010</span> <?php echo $value['image_detail']; ?>
</div>
</li>
<?php } ?>
</ul>
</div>
</div>
<script type="text/javascript">
var _lofmain = $('lofslidecontent45');
var _lofscmain = _lofmain.getElement('.lof-main-wapper');
var _lofnavigator = _lofmain.getElement('.lof-navigator-outer .lof-navigator');
var object = new LofFlashContent( _lofscmain,
_lofnavigator,
_lofmain.getElement('.lof-navigator-outer'),
{ fxObject:{ transition:Fx.Transitions.Quad.easeInOut, duration:800},
interval:3000,
direction :'hrleft' } );
object.start( true, _lofmain.getElement('.preload') );
</script>
<!------------------------------------- END OF THE CONTENT ------------------------------------------------->
<p>
More script and css style
: <a href="http://www.htmldrive.net/" title="HTML DRIVE - Free DHMTL Scripts,Jquery plugins,Javascript,CSS,CSS3,Html5 Library">www.htmldrive.net </a>
</div>
</body>
</html>