Osclass Support Forums

Osclass plugin support => User Rating Plugin => Topic started by: Ivanko on July 20, 2019, 02:08:46 PM

Title: fancy box + ajax
Post by: Ivanko on July 20, 2019, 02:08:46 PM
Original code to show user rating in user.js
Code: [Select]
//SHOW USER RATING
  $('body').on('click', 'a.show-rating', function(e) {
    e.preventDefault();

    $.get(
      $(this).attr('data-ajax-url'),
      function(response) {
        $('#ur-fancy-dialog').html($(response).contents().parent('.show-rating-wrap').html()).removeClass('ur-fancy-add').addClass('ur-fancy-show').addClass('show-rating').removeClass('new-rating');

        $('#ur-fancy-dialog').fadeIn(200).css('top', ($(document).scrollTop() + Math.round($(window).height()/20)) + 'px');
        $('#ur-fancy-overlay').fadeIn(200);
      }
    );
  });

For some reason I need to user in such way:
Code: [Select]
$(".show-rating").click(function(e) {
  e.preventDefault();

  var height = 540;
    var url = $(this).attr('data-ajax-url');
   
    if (!!$.prototype.fancybox) {
 
      $("a.show-rating").fancybox({
        'padding': 0,
        'width': 400,
        'height': height,
        'scrolling': 'yes',
        'wrapCSS': '',
        'closeBtn': true,
        'type': 'iframe',
        'href': url
     });
    }
});

But in my way in pop up window I can see contact from page too
Do you know how to achieve and hide this contact.php
it is getting contact page url link to create this staff in function.php

May be I can insert something i contact.php ?
Title: Re: fancy box + ajax
Post by: MB Themes on July 21, 2019, 02:21:15 PM
@Ivanko
Because plugin takes just something from there:
Code: [Select]
$(response).contents().parent('.show-rating-wrap').html()
Title: Re: fancy box + ajax
Post by: Ivanko on July 23, 2019, 04:17:19 PM
@Ivanko
Because plugin takes just something from there:
Code: [Select]
$(response).contents().parent('.show-rating-wrap').html()

can i wrap using fancybox in similar way?
Title: Re: fancy box + ajax
Post by: MB Themes on July 23, 2019, 06:00:25 PM
It is not wrap, it is about getting content