Post by leif on Mar 15, 2013 10:37:20 GMT -8
Hi there! I found a jquery code that works quite well in .htm files etc.
However, we're trying to use it WITHIN a jquery toggle table, but it doesn't work inside a table with other jquery. Does anyone have any to write it differently without using jquery or someting we can place anywhere?
<style>
.DateRange, .DateDiv { display: none; }
</style>
<script>
jQuery.noConflict();
$(function() {
$(".DateDiv").each(function(index) {
var sRange = $(this).find(".DateRange").html();
var arrTemp = sRange.split(" to ");
var dtFrom = new Date(arrTemp[0]);
var dtTo = new Date(arrTemp[1]);
var dtNow = new Date();
if (dtNow >= dtFrom && dtNow <= dtTo)
$(this).show();
});
});
</script>
<b>t<div class="DateDiv"><span class="DateRange">3/14/2013 to 5/15/2013</span>spring 2023</div>
<div class="DateDiv"><span class="DateRange">5/15/2013 to 6/15/2013</span>summer 2023</div>
<div class="DateDiv"><span class="DateRange">6/15/2013 to 7/15/2013</span>winter 2023</div>
<div class="DateDiv"><span class="DateRange">7/15/2013 to 8/15/2013</span>winter 2024</div>
<div class="DateDiv"><span class="DateRange">8/15/2013 to 10/15/2013</span>spring 2024</div>
<div class="DateDiv"><span class="DateRange">10/15/2013 to 11/15/2013</span>summer 2024</div>
<div class="DateDiv"><span class="DateRange">11/15/2013 to 12/15/2013</span>winter 2024</div>
<div class="DateDiv"><span class="DateRange">12/15/2013 to 1/15/2014</span>winter 2025</div>
<div class="DateDiv"><span class="DateRange">1/15/2014 to 3/15/2014</span>spring 2025</div>
<div class="DateDiv"><span class="DateRange">3/15/2014 to 5/15/2014</span>summer 2025</div>
<div class="DateDiv"><span class="DateRange">5/15/2014 to 6/15/2014</span>winter 2025</div>
<div class="DateDiv"><span class="DateRange">6/15/2014 to 7/15/2014</span>winter 2026</div>
<div class="DateDiv"><span class="DateRange">7/15/2014 to 9/15/2014</span>spring 2026</div>
<div class="DateDiv"><span class="DateRange">9/15/2014 to 10/15/2014</span>summer 2026</div>
<div class="DateDiv"><span class="DateRange">10/15/2014 to 11/15/2014</span>winter 2026</div>
<div class="DateDiv"><span class="DateRange">11/15/2014 to 12/15/2014</span>winter 2027</div>
<div class="DateDiv"><span class="DateRange">12/15/2014 to 2/15/2015</span>spring 2027</div>
However, we're trying to use it WITHIN a jquery toggle table, but it doesn't work inside a table with other jquery. Does anyone have any to write it differently without using jquery or someting we can place anywhere?