Results 1 to 2 of 2

Thread: JavaScript - lightwindow issue with iframe

  1. #1
    Join Date
    Nov 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JavaScript - lightwindow issue with iframe

    I trying for several days to solve issue with displaying iframe, I found http://www.dynamicdrive.com/forums/s...-call-party-on topic on your forum, something like this and I need to do, but I failed. Please help me how to fix issue

    I will explain in details...

    Links in xml looks like this

    <Diretktreduktion_02>
    <![CDATA[http://www.site.com/steel_agg_dr_article_en.html]]>
    </Diretktreduktion_02>
    .......

    First I parsed links from xml to html,

    Code:
    <script type="text/javascript">
        jQuery(function ($) {
            $.ajax({
                type: "GET",
                url: 'steel_en_process.xml',
                dataType: "xml",
                success: loadDiagramData
              });
              function loadDiagramData(xml) {
    
                  $(xml).find("aggregate_links").each(function() {
                    var pfannen   = $(this).find('Pfannenbehandlung_05').text();
                    var elektro   = $(this).find('Elektrolichtbogenofen_04').text();
                    var brammen   = $(this).find('Brammen_Strangguss_07_01').text();
                    var pfannen_1 = $(this).find('Pfannenbehandlung_05_01').text();
                    var direkt    = $(this).find('Diretktreduktion_02').text();
                    var torpedo   = $(this).find('Torpedopfanne_09').text();
                    var hochofen  = $(this).find('hochofen_01').text();
                    var brammen_1 = $(this).find('Brammen_Strangguss_07').text();
                    var vakuum    = $(this).find('vakuumbehandlung_06').text();
                    var sauers    = $(this).find('Sauerstoffkonverter_03').text();
    Then, I want to assign in an appropriate <div> and on click, link should get additional value "view=asIframe" and iframe should be displayed like this - http://prnt.sc/d9kbz3

    Code:
    Event.observe(window, 'load', function() {
     var overlayElements = $$('#content_items a.background-color--black');
     
     for(i=0; i<overlayElements.size(); i++) {
      overlayElements[i].observe('click', function(event) {
       openOverlayPopup(this.href);
       event.stop();
      });
     }
    });function openOverlayPopup(url) {
     contentUrl = url+"?view=asIframe";
    /* Fix the height of the overlay */
    myLightWindow._getPageDimensions();
    document.getElementById("lightwindow_overlay").setStyle({ height: myLightWindow.pageDimensions.height + 'px'});
     myLightWindow.activateWindow({
      href: contentUrl,
      title: '',
      height: 560,
      width: 540,
      type: 'external'
     });
    }

  2. #2
    Join Date
    Nov 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, I did something, but what is happening now...

    Code:
    Event.observe(window, 'load', function() {
       var overlayElements = $$('.lightwindow');
       
       for(i=0; i<overlayElements.size(); i++) {
        overlayElements[i].observe('click', function(event) {
         openOverlayPopup(this.href);
         event.stop();
        });
       };
      });
      function openOverlayPopup(url) {
       contentUrl = url+"?view=asIframe";
      /* Fix the height of the overlay */
      myLightWindow.activateWindow({
        href: contentUrl,
        title: '',
        height: 560,
        width: 540,
        type: 'external'
       });
      };
    With this code, onclick I managed to add view=asIframe at the end of link, but the frame does not get dimensions (height 560px and width 540px) and set it as params, but has dimensions width 100% and height 100%, which causes the iframe is a very very huge. Can you help me how to fix ?

Similar Threads

  1. Lightwindow 2.0 Resize to iFrame Content Problem
    By daemonhunt in forum JavaScript
    Replies: 0
    Last Post: 05-09-2011, 10:35 PM
  2. Javascript iFrame height issue?
    By nateweller in forum JavaScript
    Replies: 0
    Last Post: 04-06-2011, 10:09 PM
  3. Resolved Lightwindow from Javascript call - party on?
    By suction cup in forum JavaScript
    Replies: 8
    Last Post: 11-28-2010, 05:37 PM
  4. Replies: 0
    Last Post: 09-20-2010, 08:36 PM
  5. Replies: 1
    Last Post: 06-01-2007, 02:42 PM

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
  •