Community Forums 

Main Content

countdown script

    Dec 13 2014 12:06:37

    #1

    cassie75

    Join date : 2008-09-18      Posts : 273

    Hi Geoff - got it to work in my test account.

    Would it also have worked if I had made it into a new js file and called that in the header section?
    Only problem is I only have 13 characters left :-(

    Will probably keep as you suggest as it works - just have to remember to change both header.js AND the count script every few days :-)

    Now to implement on my 3 live sites

    Thanks everyone
    Merry Xmas

    Life is too short to work 8 hours a day - thats why I work 16 :-)




    Dec 13 2014 14:54:31

    #2

    cassie75

    Join date : 2008-09-18      Posts : 273

    Final Update - It works

    I have learnt so much over the last few hours :-)

    I was short of space in the header 255 limit so I put some of the other text using up my character spaces into the header script. Hadn't done it before as couldn't get it to do different text sizes. Didn't realise you could do more than one "document.writeln" in one script until Geoff mentioned it.

    To get round having 2 lots of files to update, I put the countdown in a second .js file and put that in header too. I then put that on my index page (and anywhere else i want it) so I only have to edit that one .js file.

    Thanks to you all - and I will look at the templates next year when I have time GT, so I may be back asking questions about that.

    Merry Xmas

    Life is too short to work 8 hours a day - thats why I work 16 :-)




    Dec 13 2014 18:28:24

    #3

    Don

    Join date : 2008-09-18      Posts : 487

    What's the URL you have it working on ?

    It's OK I have found it.

    DB

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Dec 14 2014 17:14:11

    #4

    cassie75

    Join date : 2008-09-18      Posts : 273

    The script is from
    http://www.ricocheting.com/code/javascript/html-generator/countdown-timer
    There are lots of other options you can do with the script on that page. I have edited it to what I needed.

    Life is too short to work 8 hours a day - thats why I work 16 :-)




    Dec 15 2014 13:51:52

    #5

    cassie75

    Join date : 2008-09-18      Posts : 273

    Sorry I know I said i would not update anymore, and I had this working well the other day. Have no idea what I changed.

    It looks right on our home page in all browsers and the shopping basket page in IE but Firefox and chrome are not showing the right font in the shopping basket.

    The home page is styled using a css style which I know would not work in the shopping basket page. I did that deliberately as I wanted it centered on the home page but not in the cart. But now the font in the cart is not right.

    I know I used to know how to style fonts in JavaScript but it has gone right out my head at the moment.

    Can anyone give an old girl a clue ??

    Life is too short to work 8 hours a day - thats why I work 16 :-)




    Dec 15 2014 18:45:05

    #6

    Geoff

    Join date : 2008-09-18      Posts : 415

    The div for the countdown has a css class="count". This will not be read by the cart page as the css file is not linked on that page. (It will of course be read by your homepage where it is linked.)

    It is an accident that it looks right in IE. Your file "header-fmisc.js" - second line - font tag is not closed, and there is an open <b> IE is rendering the countdown div, which is the next line in the document flow, with this line's font declaration and in bold, whereas Firefox is responding differently, rendering with default styling.

    For the cart you will need to style the countdown div in the script, which of course will mean the same style wherever that script is called. Personally, I would have separate countdown js files so you can style the divs appropriately.



    Dec 15 2014 22:48:47

    #7

    cassie75

    Join date : 2008-09-18      Posts : 273

    Hi Geoff
    You are right about the header script - have corrected. It looks like I either have the smaller text size in the home page or the bigger text in the shopping basket. Or I have two scripts as you suggest. None of them are ideal. I will have a think for a while and see what I like best :-)

    Life is too short to work 8 hours a day - thats why I work 16 :-)




       «      1   |   2