当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings::getDivClass方法代码示例

本文整理汇总了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;
    }
开发者ID:EnuygunCom,项目名称:dfp-bundle,代码行数:55,代码来源:PageSkinAdUnit.php

示例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;
    }
开发者ID:elmariachi111,项目名称:NodrewDfpBundle,代码行数:19,代码来源:AdUnit.php

示例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;
    }
开发者ID:EnuygunCom,项目名称:dfp-bundle,代码行数:20,代码来源:AdUnit.php

示例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;
    }
开发者ID:EnuygunCom,项目名称:dfp-bundle,代码行数:45,代码来源:MobileAdUnit.php

示例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;
    }
开发者ID:0x73,项目名称:dfp-bundle,代码行数:42,代码来源:ScrollAdUnit.php

示例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;
    }
开发者ID:EnuygunCom,项目名称:dfp-bundle,代码行数:88,代码来源:ScrollAdUnit.php


注:本文中的Settings::getDivClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。