2016-08-20 2 views
0

das Plugin zu verwenden ist http://www.jsplugins.net/jquery-seat-charts-plugin/ der Code wie folgt, ich habe es in f7 verwenden, aber es sagt: "Nicht abgefangene Typeerror: $$ (...) seatCharts keine Funktion." i habe schon $ zu $$ gewechselt. $ (document) .ready (function() {wie jQuery-Plugin in framework7

var sc = $('#seat-map').seatCharts({ 
    map: [ 
     'aaaaaaaaaaaa', 
     'aaaaaaaaaaaa', 
     'bbbbbbbbbb__', 
     'bbbbbbbbbb__', 
     'bbbbbbbbbbbb', 
     'cccccccccccc' 
    ], 
    seats: { 
     a: { 
      price : 99.99, 
      classes : 'front-seat' //your custom CSS class 
     } 

    }, 
    click: function() { 
     if (this.status() == 'available') { 
      //do some stuff, i.e. add to the cart 
      return 'selected'; 
     } else if (this.status() == 'selected') { 
      //seat has been vacated 
      return 'available'; 
     } else if (this.status() == 'unavailable') { 
      //seat has been already booked 
      return 'unavailable'; 
     } else { 
      return this.style(); 
     } 
    } 
}); 

//Make all available 'c' seats unavailable 
sc.find('c.available').status('unavailable'); 

/* 
Get seats with ids 2_6, 1_7 (more on ids later on), 
put them in a jQuery set and change some css 
*/ 
sc.get(['2_6', '1_7']).node().css({ 
    color: '#ffcfcf' 
}); 

console.log('Seat 1_2 costs ' + sc.get('1_2').data().price + ' and is currently ' + sc.status('1_2')); 

});

Antwort

1

Fügen Sie alle JavaScript-Dateien am Ende von body hinzu und fügen Sie jquery am Ende des JS-Skript-Tags hinzu.

enter image description here