Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import $ from 'jquery'
- class AboutClass{
- constructor(){
- this.events();
- }
- events(){
- $(document).on('click', "#more-about" ,this.showAbout.bind(this));
- $(document).on('click',"#less-about", this.hideAbout.bind(this));
- }
- showAbout(e){
- e.preventDefault();
- $("#about-container").fadeOut(1000);
- $.ajax({
- url: karyatisData.root_url + "/wp-json/k-api/v1/about?content=full",
- context: this,
- success: (data)=>{
- $("#about-container").empty();
- $("#about-container").html(data);
- $("#about-container").fadeIn(1000);
- }
- });
- }
- hideAbout(e){
- e.preventDefault();
- $("#about-container").fadeOut(1000);
- $.ajax({
- url: karyatisData.root_url + "/wp-json/k-api/v1/about?content=excerpt",
- context: this,
- success: (data)=>{
- $("#about-container").empty();
- $("#about-container").html(data);
- $("#about-container").fadeIn(1000);
- }
- });
- }
- }
- export default AboutClass;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement