本文整理汇总了PHP中Settings::getDivClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::getDivClass方法的具体用法?PHP Settings::getDivClass怎么用?PHP Settings::getDivClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::getDivClass方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output
public function output(Settings $settings)
{
$class = $this->getClass($settings->getDivClass());
$style = $this->getStyles();
$attrs = $this->getAttrsAsString();
return <<<RETURN
<div class="{$class}"{$attrs}>
<div id="{$this->divId}">
<script type="text/javascript" defer>
googletag.cmd.push(function() { googletag.display('{$this->divId}'); });
googletag.cmd.push(function() {
\$(function() {
var slideTimer = setTimeout(function() {
clearTimeout(slideTimer);
\$('div.{$class}').each(function() {
var ad = \$(this);
var container = \$('[data-role="pageskin"]');
var closed = false;
var scrolled = false;
var showAd = function(force) {
if(! closed || force) {
ad.fadeIn('fast'); scrolled = true; closed = false;
container.css('margin-top', '90px');
container.css('z-index', '2');
container.css('position', 'relative');
ad.css('top', container.offset().top - 90);
}
};
var hideAd = function() {
ad.fadeOut('fast');
container.css('margin-top', '0');
closed = true;
}
if(ad.find('div').css('display') != 'none') {
showAd();
\$(window).scroll(function () {
if (!scrolled && !closed && \$(this).scrollTop() > 40) {
showAd();
}
});
ad.find('.pageskin_ad_close').click(function(e) {
e.preventDefault();
hideAd();
});
}
});
}, 2000);
});
});
</script>
</div>
</div>
RETURN;
}
示例2: output
/**
* Output the DFP code for this ad unit
*
* @param Nodrew\Bundle\DfpBundle\Model\Settings $settings
* @return string
*/
public function output(Settings $settings)
{
$class = $settings->getDivClass();
$style = $this->getStyles();
return <<<RETURN
<div id="{$this->divId}" class="{$class}" style="{$style}">
<script type="text/javascript">
googletag.cmd.push(function() { googletag.display('{$this->divId}'); });
</script>
</div>
RETURN;
}
示例3: output
/**
* Output the DFP code for this ad unit
*
* @param Settings $settings
* @return string
*/
public function output(Settings $settings)
{
$class = $this->getClass($settings->getDivClass());
$attrs = $this->getAttrsAsString();
return <<<RETURN
<div class="{$class}"{$attrs}>
<div id="{$this->divId}">
<script type="text/javascript" defer>
googletag.cmd.push(function() { googletag.display('{$this->divId}'); });
</script>
</div>
</div>
RETURN;
}
示例4: output
public function output(Settings $settings)
{
$class = $this->getClass($settings->getDivClass());
$style = $this->getStyles();
$attrs = $this->getAttrsAsString();
return <<<RETURN
<div class="{$class}"{$attrs}>
<div id="{$this->divId}">
<script type="text/javascript" defer>
googletag.cmd.push(function() { googletag.display('{$this->divId}'); });
googletag.cmd.push(function() {
\$(function() {
var slideTimer = setTimeout(function() {
clearTimeout(slideTimer);
\$(function() {
if(\$('.ad-container').length > 0) {
\$('.ad-container > div:first').each(function() {
var el = \$(this);
// don't show when there is no ad
if(el.css('display') == 'none')
return;
var parent = el.parent();
if(parent.data('placement') === 'bottom') {
\$('body').css('padding-bottom', parent.data('height'));
\$('#feedbackButton').css('bottom', parent.data('height'));
}
parent.show();
\$('input,select,option,textarea')
.bind('focus', function() {
parent.hide();
}).bind('blur', function() {
parent.show();
});
});
}
});
}, 2000);
});
});
</script>
</div>
</div>
RETURN;
}
示例5: output
public function output(Settings $settings)
{
$class = $this->getClass($settings->getDivClass());
$style = $this->getStyles();
return <<<RETURN
<div class="{$class}">
<div id="{$this->divId}">
<a href="javascript:void(0)" class="scrolldown_ad_close">x</a>
<script type="text/javascript">
googletag.cmd.push(function() { googletag.display('{$this->divId}'); });
googletag.cmd.push(function() {
\$(function() {
var slideTimer = setTimeout(function() {
clearTimeout(slideTimer);
\$('div.{$class}').each(function() {
var ad = \$(this);
var closed = false;
var scrolled = false;
var showAd = function(force) { if(! closed || force) { ad.toggle('slow'); scrolled = true; closed = false; } }
var hideAd = function() { ad.fadeOut(); closed = true; }
if(ad.find('div').css('display') != 'none') {
showAd();
\$(window).scroll(function () {
if (!scrolled && !closed && \$(this).scrollTop() > 40) {
showAd();
}
});
ad.find('.scrolldown_ad_close').click(function(e) {
e.preventDefault();
hideAd();
});
}
});
}, 2000);
});
});
</script>
</div>
</div>
RETURN;
}
示例6: output
public function output(Settings $settings)
{
$class = $this->getClass($settings->getDivClass());
$style = $this->getStyles();
$attrs = $this->getAttrsAsString();
$attr_array = $this->getAttrs();
$closed = isset($attr_array['data-closed']) ? $attr_array['data-closed'] : 'false';
$scrolled = isset($attr_array['data-scrolled']) ? $attr_array['data-scrolled'] : 'false';
$initTimer = isset($attr_array['data-init-timer']) ? $attr_array['data-init-timer'] : 2000;
$closeBtn = isset($attr_array['data-close-btn']) ? $attr_array['data-close-btn'] : 'scrolldown_ad_close';
return <<<RETURN
<div class="{$class}"{$attrs}>
<div id="{$this->divId}">
<a href="javascript:void(0)" class="{$closeBtn}">x</a>
<script type="text/javascript">
googletag.cmd.push(function() { googletag.display('{$this->divId}'); });
googletag.cmd.push(function() {
\$(function() {
var slideTimer = setTimeout(function() {
clearTimeout(slideTimer);
\$('div.{$class}').each(function() {
var ad = \$(this);
var closed = {$closed};
var scrolled = {$scrolled};
var disabled = false;
var showAd = function(force) { if(! closed || force) { ad.toggle('fast'); scrolled = true; closed = false; } }
var hideAd = function(forced) { if(!forced && disabled) return; ad.fadeOut(); closed = true; }
if(ad.find('div').css('display') != 'none') {
showAd();
\$(window).scroll(function () {
if (!scrolled && !closed && \$(this).scrollTop() > 40) {
showAd();
}
});
ad.find('.{$closeBtn}').click(function(e) {
e.preventDefault();
hideAd();
});
}
var timeout = ad.data('timeout');
var timeout_wait = ad.data('wait-timeout');
if(timeout) {
setTimeout(function(){
// Hide function
hideAd(true);
}, timeout);
}
if(timeout_wait) {
var count=timeout_wait/1000;
var counter=setInterval(timer, 1000);
\$('.{$class} .{$closeBtn}')
.html('' + count +'')
.css('display','inline');
function timer()
{
\$('.{$class} .{$closeBtn}').html(--count);
if (count <= 0)
{
clearInterval(counter);
return;
}
}
// Disable Close Button
disabled = true;
setTimeout(function(){
// Enable Close Button
\$('.{$class} .{$closeBtn}').html('x');
disabled = false;
}, timeout_wait);
}
});
}, {$initTimer});
});
});
</script>
</div>
</div>
RETURN;
}