SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2014
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Modal Pop Up Loading Twice

    Hi Everyone,

    I hope someone could help me with this issue. When I click on a link a modal pop up comes up the problem is that the pop up is loading twice. I've been searching online but I haven't been able to solve this issue. Here is the code

    Code:
    $(function () {
        var iframe = $('<iframe frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>');
        var dialog = $("<div></div>").append(iframe).appendTo("body").dialog({
            autoOpen: false,
            modal: true,
            resizable: false,        width: "auto",
            height: "auto",
            close: function () {
                iframe.attr("src", "");
            }
    		
        });
        $(".thumb a").on("click", function (e) {
            e.preventDefault();
            var src = $(this).attr("href");
            var title = $(this).attr("data-title");
            var width = $(this).attr("data-width");
            var height = $(this).attr("data-height");
            iframe.attr({
                width: +width,
                height: +height,
                src: src
            });
            dialog.dialog("option", "title", title).dialog("open");
    		
        });
    });
    
    echo '<ul class="thumb"><li><a href="view_record.php?cid=' . $row['case_no'] . '" data-title="View Record For: ' . $row['client_name'] . '" data-width="910" data-height="330">View</a></li></ul>';

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    Could you post a link to a page where I can see this happening?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •