robulouski / voidy-bootstrap

A Pelican theme based on Bootstrap. A modern mobile-friendly theme using Bootstrap 3 and FontAwesome 4.
http://www.voidynullness.net/page/voidy-bootstrap-pelican-theme/
MIT License
66 stars 26 forks source link

javascript includes #7

Closed lgwapnitsky closed 9 years ago

lgwapnitsky commented 9 years ago

Having issue with including javascript. I've set my pelicanconf.py to have CUSTOM_SCRIPTS_BASE to point to my custom file, which contains the following:

<script src='/js/mb-comingsoon/jquery.mb-comingsoon.js"></script>
<script type="text/javascript">
    $(function () {
        var $section = $('section');
        $(window).on("resize", function () {
            var dif = Math.max($(window).height() - $section.height(), 0);
            var padding = Math.floor(dif / 2) + 'px';
            $section.css({ 'padding-top': padding, 'padding-bottom': padding });
        }).trigger("resize");
        $('#myCounter').mbComingsoon({ expiryDate: new Date(2015, 0, 1, 9, 30), speed:100 });
        setTimeout(function () {
            $(window).resize();
        }, 200);
    });
</script>

The script appears as part of my page load, but the div that I setup

<div id="myCounter"></div>

never shows on the page. Am I missing something?

Thanks Larry

robulouski commented 9 years ago

How are you setting up that "myCounter" div? How is it getting into the page?

What are you trying to achieve? If that JavaScript is present in the page source it's likely to be a problem with the JavaScript and not the theme.

lgwapnitsky commented 9 years ago

adding it in via non-indented markdown.

I've tried a few different scripts with the same results. code samples are direct from each script's site

On Fri, Mar 6, 2015 at 8:59 AM, Rob Iwancz notifications@github.com wrote:

How are you setting up that "myCounter" div? How is it getting into the page?

What are you trying to achieve? If that JavaScript is present in the page source it's likely to be a problem with the JavaScript and not the theme.

— Reply to this email directly or view it on GitHub https://github.com/robulouski/voidy-bootstrap/issues/7#issuecomment-77562234 .

robulouski commented 9 years ago

The problem is with your HTML. There's a mismatched quote in the first script block for starters.

Pelican copies the theme's static files into a "theme" subdirectory.

So I believe the first line should look something like this:

<script src="/theme/js/mb-comingsoon/jquery.mb-comingsoon.js"></script>
lgwapnitsky commented 9 years ago

damn quotes! :) Thanks!

On Mon, Mar 9, 2015 at 11:20 PM, Rob Iwancz notifications@github.com wrote:

Closed #7 https://github.com/robulouski/voidy-bootstrap/issues/7.

— Reply to this email directly or view it on GitHub https://github.com/robulouski/voidy-bootstrap/issues/7#event-249046262.