我在PHP / MySQL应用程序中使用MasterSlider插件。我使用以下配置:
var categorySlider = new MasterSlider();
categorySlider.setup('prod-gal' , {
width:550,
height:484,
speed: 25,
preload:'all',
loop:true,
view:'fade'});
我尝试了这里描述的各种配置设置:http://masterslider.com/doc/但没有成功。
然而,图像在侧面被裁剪。知道如何使用MasterSlider插件来适应图像吗?
由于
答案 0 :(得分:0)
<?php
function getDbConnection() {
$db = new PDO(DB_DRIVER . ":dbname=" . DB_DATABASE . ";host=" . DB_SERVER, DB_USER);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $db;
}
//this is for loading ratings
function home_ratings()
{
$db = getDbConnection();
$stmt = $db->prepare("select * from ratings");
$isQueryOk = $stmt->execute();
$results_ratings = array();
if ($isQueryOk)
{
$results_ratings = $stmt->fetchAll(PDO::FETCH_COLUMN);
}
else
{
trigger_error('Error executing statement.', E_USER_ERROR);
}
$db = null;
return $results_ratings;
}
?>