Changeset 479991
- Timestamp:
- 12/23/2011 08:24:18 PM (14 years ago)
- Location:
- live-countdown-timer/trunk
- Files:
-
- 6 edited
-
live-countdown-timer.php (modified) (6 diffs)
-
screenshot-1.jpg (modified) (previous)
-
screenshot-2.jpg (modified) (previous)
-
screenshot-3.jpg (modified) (previous)
-
script.js (modified) (3 diffs)
-
style.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
live-countdown-timer/trunk/live-countdown-timer.php
r476875 r479991 7 7 Author: Turcu Ciprian 8 8 License: GPL 9 Version: 3.0. 0.29 Version: 3.0.1.0 10 10 Author URI: http://www.chipree.com/ 11 11 … … 41 41 ?> 42 42 <script type="text/javascript"> 43 43 44 44 jQuery(".lct_dtp").live('hover',function(){ 45 45 jQuery(".lct_dtp").datetimepicker({ … … 68 68 echo "selected"; ?> value="2">Medium (Single box)</option> 69 69 <option <?php if ($lct_vArr['lct_type'] == "3") 70 echo "selected"; ?> value="3">Small (Single box -4 box)</option>70 echo "selected"; ?> value="3">Small (Single box)</option> 71 71 <option <?php if ($lct_vArr['lct_type'] == "4") 72 echo "selected"; ?> value="4">Big (complete timer- 4box)</option>72 echo "selected"; ?> value="4">Big (complete timer-5 box)</option> 73 73 <option <?php if ($lct_vArr['lct_type'] == "5") 74 echo "selected"; ?> value="5">Medium (complete timer- 4box)</option>74 echo "selected"; ?> value="5">Medium (complete timer-5 box)</option> 75 75 <option <?php if ($lct_vArr['lct_type'] == "6") 76 echo "selected"; ?> value="6">Small (complete timer- 4box)</option>76 echo "selected"; ?> value="6">Small (complete timer-5 box)</option> 77 77 </select><br/> 78 78 Pick Date and Time:<br/> … … 121 121 case "4": 122 122 echo '<div class="LCT">'; 123 echo '<div class="big"><div class="type">YEARS</div><div class="bg"><p>--</p><div class="over"></div></div></div>'; 123 124 echo '<div class="big"><div class="type">DAYS</div><div class="bg"><p>--</p><div class="over"></div></div></div>'; 124 125 echo '<div class="big"><div class="type">HOURS</div><div class="bg"><p>--</p><div class="over"></div></div></div>'; … … 129 130 case "5": 130 131 echo '<div class="LCT">'; 132 echo '<div class="medium"><div class="type">YEARS</div><div class="bg"><p>--</p><div class="over"></div></div></div>'; 131 133 echo '<div class="medium"><div class="type">DAYS</div><div class="bg"><p>--</p><div class="over"></div></div></div>'; 132 134 echo '<div class="medium"><div class="type">HOURS</div><div class="bg"><p>--</p><div class="over"></div></div></div>'; … … 137 139 case "6": 138 140 echo '<div class="LCT">'; 141 echo '<div class="small"><div class="type">YEARS</div><div class="bg"><p>--</p><div class="over"></div></div></div>'; 139 142 echo '<div class="small"><div class="type">DAYS</div><div class="bg"><p>--</p><div class="over"></div></div></div>'; 140 143 echo '<div class="small"><div class="type">HOURS</div><div class="bg"><p>--</p><div class="over"></div></div></div>'; -
live-countdown-timer/trunk/script.js
r476219 r479991 13 13 var hours=minutes*60; 14 14 var days=hours*24; 15 //var years=days*365;15 var years=days*365; 16 16 17 var db_time = new Date(tempdate[1]+' '+tempdate[2]+', '+tempdate[0]+' '+temptime[0]+':'+temptime[1]+':00' );17 var db_time = new Date(tempdate[1]+' '+tempdate[2]+', '+tempdate[0]+' '+temptime[0]+':'+temptime[1]+':00'); 18 18 var now_time = new Date(); 19 19 db_time = db_time.getTime(); … … 21 21 var lctresult = db_time-now_time; 22 22 23 lct_days = Math.floor(lctresult/days); 24 lct_hours = Math.floor(lctresult/hours)-(lct_days*24); 25 lct_minutes = Math.floor(lctresult/minutes)-(lct_hours*60)-(lct_days*24*60); 26 lct_seconds = Math.floor(lctresult/seconds)-(lct_minutes*60)-(lct_hours*60*60)-(lct_days*60*24*60); 27 if(lct_days>99)lct_days=99; 23 lct_years = Math.floor(lctresult/years); 24 lct_days = Math.floor(lctresult/days)-(lct_years*365); 25 lct_hours = Math.floor(lctresult/hours)-(lct_days*24)-(lct_years*365*24); 26 lct_minutes = Math.floor(lctresult/minutes)-(lct_hours*60)-(lct_days*24*60)-(lct_years*365*24*60); 27 lct_seconds = Math.floor(lctresult/seconds)-(lct_minutes*60)-(lct_hours*60*60)-(lct_days*60*24*60)-(lct_years*365*24*60*60); 28 singlebox=false; 29 if(lct_years>99){ 30 lct_years=99; 31 } 32 if(lct_days>99){ 33 34 singlebox=true; 35 } 36 if(lct_years<0)lct_years=0; 28 37 if(lct_days<0)lct_days=0; 29 if(lct_hours>24)lct_hours=24;30 38 if(lct_hours<0)lct_hours=0; 31 39 if(lct_minutes>60)lct_minutes=60; 32 40 if(lct_minutes<0)lct_minutes=0; 33 if(lct_seconds>60)lct_seconds=60;34 41 if(lct_seconds<0)lct_seconds=0; 42 35 43 36 if(jQuery('.LCT').find('div.type').siblings().length==4){ 37 jQuery('.LCT').find('div:nth-child(1) .bg p').html(lct_days); 38 jQuery('.LCT').find('div:nth-child(2) .bg p').html(lct_hours); 39 jQuery('.LCT').find('div:nth-child(3) .bg p').html(lct_minutes); 40 jQuery('.LCT').find('div:nth-child(4) .bg p').html(lct_seconds); 44 if(jQuery('.LCT').find('div.type').siblings().length==5){ 45 jQuery('.LCT').find('div:nth-child(1) .bg p').html(lct_years); 46 jQuery('.LCT').find('div:nth-child(2) .bg p').html(lct_days); 47 jQuery('.LCT').find('div:nth-child(3) .bg p').html(lct_hours); 48 jQuery('.LCT').find('div:nth-child(4) .bg p').html(lct_minutes); 49 jQuery('.LCT').find('div:nth-child(5) .bg p').html(lct_seconds); 50 51 if(jQuery('.LCT div:nth-child(2)').hasClass('big')){ 52 if(singlebox==true)jQuery('.LCT div:nth-child(2).big .bg p').addClass("evensmaller"); 53 } 54 if(jQuery('.LCT div:nth-child(2).medium').hasClass('medium')){ 55 if(singlebox==true)jQuery('.LCT div:nth-child(2).medium .bg p').addClass("evensmaller"); 56 } 57 if(jQuery('.LCT div:nth-child(2).small').hasClass('small')){ 58 if(singlebox==true)jQuery('.LCT div:nth-child(2).small .bg p').addClass("evensmaller"); 59 } 41 60 }else{ 42 if(lct_days!=0 && lct_days>0){ 43 jQuery('.LCT').find('div .bg p').html(lct_days); 61 if(lct_years!=0 && lct_years>0){ 62 jQuery('.LCT').find('div .bg p').html(lct_years); 63 jQuery('.LCT div .type').html('YEARS'); 64 }else if(lct_days!=0 && lct_days>0){ 65 jQuery('.LCT').find('div .bg p').html(lct_days); 44 66 jQuery('.LCT div .type').html('DAYS'); 45 67 }else if(lct_hours!=0 && lct_hours>0){ … … 54 76 } 55 77 78 if(jQuery('.LCT div:nth-child(1).big').length!=0){ 79 if(singlebox==true)jQuery('.LCT div:nth-child(1).big .bg p').addClass("evensmaller"); 80 } 81 if(jQuery('.LCT div:nth-child(1).medium').length!=0){ 82 if(singlebox==true)jQuery('.LCT div:nth-child(1).medium .bg p').addClass("evensmaller"); 83 } 84 if(jQuery('.LCT div:nth-child(1).small').length!=0){ 85 if(singlebox==true)jQuery('.LCT div:nth-child(1).small .bg p').addClass("evensmaller"); 86 } 56 87 } 57 88 -
live-countdown-timer/trunk/style.css
r476219 r479991 6 6 body .LCT .big .bg{width:124px;height:117px;background:url(images/big_bg.png);text-align:center;} 7 7 body .LCT .big .bg p{width:124px;height:117px;text-align: center; margin:0px;padding:0px;font-size:66px;padding-top:8px;line-height:80px;color:#000;} 8 body .LCT .big .bg p.evensmaller{font-size:48px;} 8 9 body .LCT .big .bg .over{margin-left:4px;width:115px;height:65px;background:url(images/big_over.png);margin-top:-124px;} 9 10 /*medium*/ … … 12 13 body .LCT .medium .bg{width:75px;height:71px;background:url(images/medium_bg.png);text-align:center;} 13 14 body .LCT .medium .bg p{width:75px;height:71px;text-align: center; margin:0px;padding:0px;font-size:45px;padding-top:1px;line-height:55px;color:#000;} 15 body .LCT .medium .bg p.evensmaller{font-size:32px;} 14 16 body .LCT .medium .bg .over{margin-left:4px;width:69px;height:65px;background:url(images/medium_over.png);left:0px;margin-top:-71px;} 15 17 /*small*/ … … 18 20 body .LCT .small .bg{width:38px;height:36px;background:url(images/small_bg.png);text-align:center;} 19 21 body .LCT .small .bg p{width:38px;height:36px;text-align: center; margin:0px;padding:0px;font-size:20px;padding-top:2px;line-height:23px;color:#000;} 22 body .LCT .small .bg p.evensmaller{font-size:14px;} 20 23 body .LCT .small .bg .over{margin-left:2px;width:35px;height:21px;background:url(images/small_over.png);margin-top:-37px;} 21 24
Note: See TracChangeset
for help on using the changeset viewer.