Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing the countdown? #20

Open
daveydave opened this issue Jun 18, 2014 · 3 comments
Open

Resizing the countdown? #20

daveydave opened this issue Jun 18, 2014 · 3 comments

Comments

@daveydave
Copy link

I have this working well right now on a bootstrap-based site. The digits are a little big for what I want though and was wondering if there was an easy way to scale this? At first glance it didn't look possible since the sprite was a fixed size, but I'm probably overlooking something obvious.

Thanks!

@ghost
Copy link

ghost commented Apr 23, 2015

This is what I did. First add an extra pixel to the width in the psd (left or right). The width should now be 68px. Now you can divide evenly by 2 (45px & 34px). Pass the width and height options such as:

$('.digits').countdown({
image: "img/digits.png",
digitWidth: 34,
digitHeight: 45
});

and in CSS you need to make sure to set the background to 100%.

.cntDigit {
background-size:100% !important;
}

Hope this is useful for someone in the future.

@ManmeetGWB
Copy link

ManmeetGWB commented Sep 2, 2016

This is superb! I think others could benefit from this. I was just getting fed up with this issue for last two days. Thanks a lot !

@MonteShaffer
Copy link

This seems to work easier ... Got the idea from here:

https://stackoverflow.com/questions/17333254/scale-the-contents-of-a-div-by-a-percentage

<script>
	  $(function(){
        $("#clock-2").countdown({
          image: "img/digits.png",
          format: "mm:ss",
          endTime: new Date(2013, 12, 2)
        });
      });
    </script>
<div id="clock-2" style="zoom: 0.5; -moz-transform: scale(0.5);"></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants