2015-02-23 1 views
1

У меня есть родительская страница, которая находится внутри iframe. Я хотел бы назвать highslide, который следует за списком на родительской странице.Highslide не следующая прокрутка на странице

Я попытался размещая код: Highslide, Auto follow scroll

Это прекрасно работает, когда родительская страница не в плавающем фрейме. Но когда родительская страница внутри iframe, Highslide не может автоматически следовать за прокруткой.

Pls помощь на этом

ответ

2

Поместите скрипт для Highslide фиксированных всплывающих мод (http://www.highslide.com/studies/position-fixed.html) в родительской странице и использовать Highslide-full.js вместо Highslide-с-gallery.js/Highslide-с- html.js

Демонстрационная страница: http://roadrash.no/hs-support/inside-iframe-fixed-mod.html

// Highslide fixed popup mod. Requires the "Events" component. 
    if (!hs.ie || hs.uaVersion > 6) hs.extend (hs.Expander.prototype, { 
     fix: function(on) { 
     var sign = on ? -1 : 1, 
      stl = this.wrapper.style; 

     if (!on) hs.getPageSize(); // recalculate scroll positions 


     hs.setStyles (this.wrapper, { 
      position: on ? 'fixed' : 'absolute', 
      zoom: 1, // IE7 hasLayout bug, 
      left: (parseInt(stl.left) + sign * hs.page.scrollLeft) +'px', 
      top: (parseInt(stl.top) + sign * hs.page.scrollTop) +'px' 
     }); 

     if (this.outline) { 
      stl = this.outline.table.style; 
      hs.setStyles (this.outline.table, { 
      position: on ? 'fixed' : 'absolute', 
      zoom: 1, // IE7 hasLayout bug, 
      left: (parseInt(stl.left) + sign * hs.page.scrollLeft) +'px', 
      top: (parseInt(stl.top) + sign * hs.page.scrollTop) +'px' 
      }); 

     } 
     this.fixed = on; // flag for use on dragging 
     }, 
     onAfterExpand: function() { 
      this.fix(true); // fix the popup to viewport coordinates 
     }, 

     onBeforeClose: function() { 
     this.fix(false); // unfix to get the animation right 
     }, 

     onDrop: function() { 
      this.fix(true); // fix it again after dragging 
     }, 

     onDrag: function(sender, args) { 
     //if (this.fixed) { // only unfix it on the first drag event 
      this.fix(true); 
     //} 
     } 

    });