Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function($){
- $(function(){
- $(document).on('click','.offer,.last-offer', function(){
- $('.offer,.last-offer').removeClass('active');
- $(this).addClass('active');
- // var icon = $(this).find('img')[0].outerHTML;
- // var lastIcon = $('.last-offer').find('img')[0].outerHTML;
- var offerValue =$(this).find('input').val();
- // $('#choice').show(icon);
- $('#final').html(offerValue);
- if($('#last-offer').is(':checked')){
- $('#choice').html(lastIcon);
- var lastOfferValue = $('#last-offer').val();
- $('#final').html(lastOfferValue);}
- else{
- $('.last-offer').removeClass('active');
- lastIcon=" ";
- lastOfferValue=" ";
- $('#choice').html(lastIcon);
- $('#final').html(lastOfferValue);
- };
- if($('.offer').hasClass('active')){
- // $('#choice').html(icon);
- $('#final').html(offerValue);
- };
- if(($('.offer').hasClass('active'))&&($('#last-offer').is(':checked'))){
- // $('#choice').html(icon+'&'+lastIcon);
- var sum = (parseInt(offerValue)+parseInt(lastOfferValue));
- $('#final').html(sum);
- };
- /*
- $('#choice').html(icon);
- var sum = offerValue + lastOfferValue;
- $('#final').html(sum);
- */
- /*
- if($("input[name='offer']").is(':checked')){
- $('#choice').html(icon);
- };
- if(($('#last-offer').is(':checked'))&&($("input[name='offer']").is(':checked'))){
- $('#choice').html(icon+'&'+lastIcon);
- };
- if(($('#last-offer').is(':checked'))&&(!$("input[name='offer']").is(':checked'))){
- $('#choice').html(lastIcon);
- };
- */
- });
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement