不要将宣传脚本称为指定的分辨率

时间:2015-10-15 13:20:02

标签: javascript jquery css javascript-events

我的代码有问题。所以我有2块宣传。第一个:

<div id="top-pub" style="margin-bottom: 10px;">
    <style type="text/css">
        #gameBackground{
            margin-top: 10px;
            margin-bottom: 10px;
        }
    </style>
    {% block site_under %}
        <script type="text/javascript">
            sas.call("std", {
                siteId: 12345,    //
                pageId: 12345,    // Page : Prizee/home
                formatId: 12345,    // Format : Prizee - Megabanner 728x90
                target: ''    // Ciblage
            });
        </script>
        <noscript>
            <a href="http://www6.smartadserver.com/ac?jump=1&nwid=12345&siteid=1234&pgname=home&fmtid=12345&visit=m&tmstp=[timestamp]&out=nonrich" target="_blank">
                <img src="http://www6.smartadserver.com/ac?out=nonrich&nwid=12345&siteid=12345&pgname=home&fmtid=12345&visit=m&tmstp=[timestamp]" border="0" alt="" /></a>
        </noscript>
    {% endblock %}
</div>

第二块:

<div class="right-bloc-pub-1">
    {% block right_pub %}
    <script type="text/javascript">
        sas.call("std", {
            siteId: 4321,    //
            pageId: 4321,    // Page : Prizee/home
            formatId: 4321,    // Format : Prizee - 300x600 300x600
            target:        ''    // Ciblage
        });
    </script>
    <noscript>
        <a href="//www6.smartadserver.com/ac?jump=1&nwid=4321&siteid=4321&pgname=home&fmtid=4321&visit=m&tmstp=[timestamp]&out=nonrich" target="_blank">
            <img src="//www6.smartadserver.com/ac?out=nonrich&nwid=4321&siteid=4321&pgname=home&fmtid=4321&visit=m&tmstp=[timestamp]" border="0" alt="" /></a>
    </noscript>
    {% endblock %}
</div>

现在我在.css中:

@media only screen and (min-width: 1300px) {
#top-pub{
  display: none !important;
 }
}

如果分辨率小于1300,我实际上不要为id:#top-pub调用脚本。不仅要隐藏它们。有可能这样做吗? Thx提前。对不起我的英文

0 个答案:

没有答案