I have a demonstation here: DEMO
You should be able to see audio players displayed in a slider. The issue I am having is that I do not know how to center the audio player into the middle of slider. How can this be acheived and I want this working in all browsers:
Below is code displaying slider and an iframe which links to the audio player itself:
<style>
#galleriaaudio_<?php echo $key; ?>{ width: 550px; height: 200px; background: #000; }
</style>
<div id="galleriaaudio_<?php echo $key; ?>">
<?php
foreach ($arrAudioFile[$key] as $a) { ?>
<img class="iframe" src="Images/audiothumbnail.png">
<?php $j++; ?>
<?php } ?>
</div><br/>
<script type="text/javascript">
Galleria.loadTheme('jquery/classic/galleria.classic.min.js');
Galleria.run('#galleriaaudio_<?php echo $key; ?>');
</script>
<?php
}
I am using Galleria as my slider and documentation could be found here if you want to see: http://galleria.io/docs/
MORE INFORMATION:
I only want audio players in the slider to be centred in the slider.
Below is full code where if there is no audio then it displays a blank, if there is one audio then display single audio player on page (that is most of the code below), if multiple audio players then display in slder. This is for each questions even though I have not included the loop for each question in code snippet below:
//start:procedure audio
$aud_result = '';
if(empty($arrAudioFile[$key])){
$aud_result = ' ';
}else{
$j = 0;
if(count($arrAudioFile[$key]) == 1){
foreach ($arrAudioFile[$key] as $a) {
$info = pathinfo('AudioFiles/'.$a);
?>
<script type="text/javascript">
$(document).ready(function(){
$("#jquery_jplayer-<?php echo $key.'-'.$j; ?>").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
<?php echo $info['extension'];?>: "<?php echo "AudioFiles/".$a; ?>"
});
$(this).bind($.jPlayer.event.play, function() {
$(this).jPlayer("pauseOthers");
});
},
cssSelectorAncestor: "#jp_container_<?php echo $key.'-'.$j; ?>",
cssSelectorAncestor: "#jp_interface_<?php echo $key.'-'.$j; ?>",
solution:"flash,html",
swfPath: "jquery",
supplied: "<?php echo $info['extension'];?>"
});
});
</script>
<div id="jquery_jplayer-<?php echo $key.'-'.$j; ?>" class="jp-jplayer"></div>
<div id="jp_container_<?php echo $key.'-'.$j; ?>" class="jp-audio">
<div class="jp-type-single">
<div class="jp-gui jp-interface" id="jp_interface_<?php echo $key.'-'.$j; ?>">
<ul class="jp-controls">
<li>play</li>
<li>pause</li>
<li>stop</li>
<li>mute</li>
<li>unmute</li>
<li>max volume</li>
</ul>
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-time-holder">
<div class="jp-current-time"></div>
<div class="jp-duration"></div>
<ul class="jp-toggles">
<li>repeat</li>
<li>repeat off</li>
</ul>
</div>
</div>
</div>
</div>
<?php
}
}else if(count($arrAudioFile[$key]) > 1){
?>
<style>
#galleriaaudio_<?php echo $key; ?>{ width: 550px; height: 200px; background: #000; margin:0; }
</style>
<div id="galleriaaudio_<?php echo $key; ?>">
<?php
foreach ($arrAudioFile[$key] as $a) { ?>
<img class="iframe" src="Images/audiothumbnail.png">
<?php $j++; ?>
<?php } ?>
</div><br/>
<script type="text/javascript">
Galleria.loadTheme('jquery/classic/galleria.classic.min.js');
Galleria.run('#galleriaaudio_<?php echo $key; ?>');
</script>
<?php
}
}
//end:procedure audio
You can center by adding margin: 0 auto to the element you want to center.
.jp-audio {
margin: 0 auto;
}
Please note that this only works if the element is a block element and has a set width.
Apply these styles, It should work
div.jp-audio {
margin: auto !important;
width: 85% !important;
}
Related
After submitting the message page is reloading with message box content scrolled up. I want scrolled down as shown in image like facebook messenger. I am trying many ways but not getting the proper output.
chat form
<?php foreach ($b_to_c as $row) { ?>
<?php
if ($row->From == 'customer') {
?>
<div class="left">
<div class="row">
<div class="col-md-1">
<?php if (empty($roww->customer_image[0]) || empty($roww->supplier_image)) { ?>
<img src="<?php echo base_url(); ?>images/default.jpg" class="img-circle" width="30px" height="30px"/>
<?php } else { ?>
<img src="<?php echo 'data:image;base64,' . $roww->supplier_image; ?>" class="img-circle" width="30px" height="30px"/>
<?php } ?>
<!--<img src="<?php // echo 'data:image;base64,' .$roww->supplier_image; ?>" class="img-circle" width="30px" height="30px"/>-->
</div>
<div class="col-md-11">
<div class="left_msg_block">
<?php $timestamp1 = strtotime($row->msg_sent_time); ?>
<?php $mesgtimming = date(' D-h:i A', $timestamp1); ?>
<div class="left_messagetext"><?php echo $row->message; ?></div>
</div>
</div>
</div>
</div>
<?php } else { ?>
<div class="right">
<div class="row">
<div class="col-md-12">
<div class="right_msg_block">
<?php $timestamp1 = strtotime($row->msg_sent_time); ?>
<?php $mesgtimming = date(' D-h:i A', $timestamp1); ?>
<div class="right_messagetext"><?php echo $row->message; ?></div>
</div>
</div>
</div>
</div>
<?php
}
}
?>
css code
.left_messagetext a{
color: rgba(0, 0, 0, 1);
}
.right_messagetext{
background-color: #0084ff;
margin: 1px 0;
padding: 6px 12px;
word-wrap: break-word;
clear: right;
float: right;
border-bottom-left-radius: 1.3em;
border-top-left-radius: 1.3em;
max-width: 60%;
}
.right_messagetext a{
color:#fff;
}
.scrollstarts{
overflow-y:scroll;
max-height: 500px;
overflow-x:hidden;
padding:3%;
}
.left_messagetext{
background-color: #d0cbcb;
margin: 1px 0;
padding: 6px 12px;
border-bottom-right-radius: 1.3em;
border-top-right-radius: 1.3em;
clear: left;
float: left;
word-wrap: break-word;
max-width: 60%;
}
controller code
$data['b_to_c'] = $this->Profile_model->Buyer_s($pid);
$this->load->view('buyermessageview', $data)
Model code
public function Buyer_s($pid) {
$this->db->select('*');
$this->db->from('communication');
$this->db->join('supplier_otherdetails', 'supplier_otherdetails.supplierid_fk = communication.supplier_id');
$this->db->join('customer_registration', 'communication.Customer_id=customer_registration.id');
$array = array('communication.product_id' => $pid, 'communication.Customer_id' => $this->session->id);
// $where = "communication.From='customer' and 'communication.Customer_id',$this->session->id";
$this->db->where($array);
$this->db->order_by("msg_sent_time", "asc");
$query = $this->db->get();
$results = [];
if ($query->num_rows() > 0) {
$results = $query->result();
}
return $results;
}
You could maybe use javascript to scroll to the bottom of the page?
Example:
<script>
// scroll to the bottom of the page
window.scrollTo(0,document.body.scrollHeight);
</script>
Or, if it's just in the message-box you want to go down, you could use:
<script>
// scroll to the bottom of messagediv
var messageDiv = document.getElementById("your_div");
messageDiv.scrollTop = messageDiv.scrollHeight;
</script>
You could of course wrap the script in a function and call it whenever, on a timed basis with setTimeout() or on page load etcetera...
we have review tab in product page here , please search using CTRL + F for "review"
once we click on "Be the first to review this product", it displaying like this , means complete design is spoiled
<div class="form-add">
<h2><?php echo $this->__('Write Your Own Review') ?></h2>
<?php if ($this->getAllowWriteReviewFlag()): ?>
<form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
<?php echo $this->getBlockHtml('formkey'); ?>
<?php echo $this->getChildHtml('form_fields_before')?>
<h3><?php echo $this->__("You're reviewing:"); ?>
<span><?php echo $this->escapeHtml($this->getProductInfo()->getName()) ?></span>
</h3>
<div class="fieldset">
<?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
<h4><?php echo $this->__('How do you rate this product?') ?> <em class="required">*</em></h4>
<span id="input-message-box"></span>
<table class="data-table review-summary-table ratings" id="product-review-table">
Because When you click on link you .main-container has .col2-right-layout and default it have .col1-layout.
Your .col-main has float:left and width:75%, so you need to change css or you need to change class name.
Default layout has css:
.col1-layout .col-main {
float: none;
padding: 0;
width: auto;
}
So you need to add css for other page like this:
.review-product-list .col2-right-layout .col-main {
float: none;
padding: 0;
width: auto;
}
I have a site with a sticky footer, which is not so sticky and I am having a hard time figuring it out.
This is the html part: html.tpl.php
<?php
?>
<!DOCTYPE html>
<head>
<?php $head; ?>
<title><?php print $head_title='Vit | Kringvarp Føroya'; ?></title>
<?php if ($default_mobile_metatags): ?>
<?php endif; ?>
<meta http-equiv="cleartype" content="on">
<?php print $styles; ?>
<?php print $scripts; ?>
<?php if ($add_html5_shim and !$add_respond_js): ?>
<?php elseif ($add_html5_shim and $add_respond_js): ?>
<?php elseif ($add_respond_js): ?>
<?php endif; ?>
</head>
<body class="<?php print $classes; ?>" <?php print $attributes;?>>
<div class="container">
<?php if ($skip_link_text && $skip_link_anchor): ?>
<p id="skip-link">
<a href="#<?php print $skip_link_anchor; ?>" class="element-invisible
element-focusable"><?php print $skip_link_text; ?></a>
</p>
<?php endif; ?>
<?php print $page; ?>
</div>
<?php print $page_footer; ?>
</body>
<?php print $page_bottom; ?>
</div>
</html>
And page.tpl.php part
<div id="navigation">
<?php print render($page['navigation']); ?>
</div>
<header class="header" id="header" role="banner">
<?php $front_page='http://kvf.fo/vit';
if ($logo): ?>
<a href="<?php print $front_page; ?>" title="<?php print
t('Heim'); ?>"
rel="home" class="header__logo" id="logo"><img src="<?php print
$logo; ?
>" alt="<?php print t('Heim'); ?>" class="header__logo-image" />
</a>
<?php endif; ?>
<?php if ($site_name || $site_slogan): ?>
<div class="header__name-and-slogan" id="name-and-slogan">
<?php if ($site_name): ?>
<h1 class="header__site-name" id="site-name">
<a href="<?php print $front_page; ?>" title="<?php print t('Heim');
?>" class="header__site-link" rel="home"><span><?php print
$site_name; ?></span></a>
</h1>
<?php endif; ?>
<?php if ($site_slogan): ?>
<div class="header__site-slogan" id="site-slogan"><?php print
$site_slogan; ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php print render($page['header']); ?>
</header>
<div id="main">
<?php print render($page['content']); ?>
</div>
<?php print render($page['footer']); ?>
<?php print render($page['bottom']); ?>
The css part.
html {
position: relative;
min-height: 100%;
}
body {
height: 100%;
}
.container {
margin: 0 0 125px;
}
#footer {
position: absolute;
left: 0;
bottom: 0;
height: 100px;
width: 100%;
}
The page adress is www.kvf.fo/vit , and it seems to be working ok, but on an Ipad, the footer "sinks" halfway under the bottom of the screen, which is a bummer because the main users to the site, are Ipad users :/
Any help is much obliged!
If you want your footer to be sticky so add this property in its css
footer {
position: fixed;
}
It seems you're closing the body tag to early:
</div>
<?php print $page_footer; ?>
</body>
<?php print $page_bottom; ?>
</div>
Hi i'm create website for mobile phone,
but i have a problem
i want add space in between box css
this is screenshot
and this is my code
<?php
include "connection.php";
?>
<ul data-role="listview" data-icon="false" data-divider-theme="a">
<li data-role="list-divider"><center><font color="white"><b>Sekolah Rekomendasi</b></font></center></li>
<div id="owl-demo-5">
<?php
$dataskl = mysqli_query($con,"SELECT alamat,diskon,link,logo,kode,nama_sekolah,vvip from sekolah where vvip='Ya' order by id_sekolah desc limit 0,10");
while ($skl = mysqli_fetch_object($dataskl))
{
$jd = $skl->link;
?>
<div style="border-style:solid;border-width:2px;width:162px;" class='product_item'>
<div>
<a data-ajax="false" href='<?php echo $jd ?>'>
<img style="float:left; margin-right:8px;width:70px;height:85px;" src='images/sekolah/logo/<?php echo $skl->logo ?>' class='c_image_1' alt=''>
</a>
<?php if ($skl->diskon=="Ya") { ?>
<div class='ribbon'><img src='images/biaya.png' alt=''></div>
<?php } else { } ?>
</div>
<?php
$ptng_nama = substr($skl->nama_sekolah,0,15);
$ptng_alamat = substr($skl->alamat,0,34);
?>
<div class='product_info'>
<a style="text-decoration:none" data-ajax="false" href='<?php echo $jd ?>'><font size="1"><?php echo $ptng_nama ?></font></a><br/>
<font size="1"><?php echo $ptng_alamat ?></font><br/>
<?php
$datac_pre = mysql_query("select count(id_kunjungan) as hitung from sekolah_kunjungan where kode='$skl->kode' and tgl_kunjungan between '$web->range_awal' and '$web->range_akhir'");
$cpre = mysql_fetch_object($datac_pre); ?>
<font size='1' color='blue'>Dilihat : <?php echo $cpre->hitung ?></font>
</div>
</div>
<?php } ?>
</div>
</ul>
How to add space in between box ?
helpme thank's
You can use margin or padding property in the css rules for those blocks.
CSS:
body, html {
margin:0;
padding:0;
}
div {
width:100px;
display:inline-block;
border:1px solid black;
height:300px;
}
.a {
margin-right:20px;
}
HTML:
<div class="a"></div><div class="b"></div>
I'm having following codes in osclass\oc-content\themes\modern\item.php,
<strong class="share"><?php _e('Map', 'modern'); ?></strong>
<strong class="share"><?php _e('Photo Gallery', 'modern'); ?></strong>
<div class="map" style="display:none;">
<?php osc_run_hook('location'); ?>
</div>
<div class="slider-wrapper theme-light image" >
<div id="slider" class="nivoSlider">
<?php if( osc_images_enabled_at_items() ) { ?>
<?php if( osc_count_item_resources() > 0 ) { ?>
<?php for ( $i = 0; osc_has_item_resources(); $i++ ) { if (osc_resource_for() == 2 ) { ?>
<img src="<?php echo osc_resource_url(); ?>" width="100%" height="240px;" alt="<?php echo osc_item_title(); ?>" title="<?php echo osc_item_title(); ?>" />
<?php } } ?>
<?php } ?>
<?php } osc_reset_resources(); ?>
</div>
</div>
and JavaScript code is,
$("#photo").click(function() {
$(".image").css("display","block");
$(".map").css("display","none");
});
$("#map").click(function() {
$(".map").css("display","block");
$(".image").css("display","none");
});
here photo is loading as good. But map makes following problem when I click #map.
If I load map at 1st and set display:none; to .image means, map will be loaded as fully and good.
Where is the problem?
I just tested version 3.1 and it's working on my localhost