Myoji
Myoji

Reputation: 279

Issue calling JS function twice

I am having an issue calling this function twice. I wanted to have it render to two separate divs but with separate dates but it breaks and does not render anything. I am using the following countdown plugin.

http://codecanyon.net/item/jcountdown-mega-package/3443480?WT.oss_phrase=&WT.oss_rank=3&WT.z_author=ufoufoufo&WT.ac=search_list

    jQuery(".counter").jCountdown({
        timeText:"2014/12/27 00:00:00",
        timeZone:8,
        style:"flip",
        color:"black",
        width:260,
        textGroupSpace:15,
        textSpace:0,
        reflection:false,
        reflectionOpacity:10,
        reflectionBlur:0,
        dayTextNumber:2,
        displayDay:true,
        displayHour:true,
        displayMinute:true,
        displaySecond:true,
        displayLabel:false,
        onFinish:function(){
            $('.counter').hide();
        }
    });

Upvotes: 0

Views: 76

Answers (1)

holl
holl

Reputation: 308

On the plugin support page, the author says the following:

Hi, all you need is add two , and make sure you set different id, and you can create the countdown via javascript.

He gives this example:

<div id="first_countdown" />
<div id="second_countdown" />
<script>
jQuery("#first_countdown")..........
jQuery("#second_countdown")..........
</script>

Upvotes: 1

Related Questions