*

Ivanko

  • ****
  • 328 posts
fancy box + ajax
« 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 ?
« Last Edit: July 20, 2019, 05:25:09 PM by Ivanko »

*

MB Themes

Re: fancy box + ajax
« Reply #1 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()
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • ****
  • 328 posts
Re: fancy box + ajax
« Reply #2 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?

*

MB Themes

Re: fancy box + ajax
« Reply #3 on: July 23, 2019, 06:00:25 PM »
It is not wrap, it is about getting content
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots