[DYNIFS] on Mac OSX Safari ?
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> Widgets Discussion -> Javascript Snippets
View previous topic :: View next topic  
Author Message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Wed Apr 26, 2006 11:51 pm    Post subject: Reply with quote

They use the correct one. I just snipped off the uninteresting stuff.

Changing your value brought nothing. I stress-testet the thing myself and the curious thing: Sometines it works, sometimes only half - and sometimes not. Rolling Eyes With or without your other script within the forum php file, doesn't matter.

I see some timer variables - maybe "play" around with some of these?

.. trying
 
Back to top
View user's profile Send private message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Wed Apr 26, 2006 11:52 pm    Post subject: Reply with quote

But no, that looks like just an ID for the render process not a render-timeout-value. Hmmmmm 
Back to top
View user's profile Send private message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Thu Apr 27, 2006 12:04 am    Post subject: Reply with quote

Just an idea: Maybe due to this weird differences for the several reload-tries -the rendering process isn't finished before your script want's to get the size for the center frame? Maybe add a timer / timeout or such a thing? 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Apr 27, 2006 12:09 am    Post subject: Reply with quote

hmm... maybe. You could try using setTimeout in the onload attrib of the IFrame, like this:

Code:
<iframe width="100%" height="500"
    id="myiframe" name="myiframe"
    src="http://www.phpmix.org/files/samples/dynifs/dynifs01.html"
    onload="setTimeout('DYNIFS.resize(\'myiframe\');', 100)"
    scrolling="no"
    style="width:100%;height:500px;border:1px dotted #BEBEBE;">
Sorry, your browser doesn't seem to support IFrames!
</iframe>

The backslashes are imporant. 100 here is milliseconds, you can play with it.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Thu Apr 27, 2006 12:11 am    Post subject: Reply with quote

Again.....

I found out that the larger the content of the iFrame is - the longer it takes to render (?!) it - the more your script works.
 
Back to top
View user's profile Send private message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Thu Apr 27, 2006 12:15 am    Post subject: Reply with quote

Looks good with your timeout add for me. I'll ask my mates tomorrow to re-test it! Very Happy

Sleep well!
 
Back to top
View user's profile Send private message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Thu Aug 10, 2006 4:11 pm    Post subject: Reply with quote

Works very well that way for our board!! And if you put this into the site to be iFramed, you can make sure it'll be only loaded with the surrounding page & not alone:

Code:
<script type="text/javascript">
if (top.location == self.location)
{
top.location.href = 'surrounding.URL.here' ;
}
</script>


Now setting up the script for another iFrame thing on our page...
 
Back to top
View user's profile Send private message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Tue Aug 22, 2006 10:22 am    Post subject: Reply with quote

Found a quite little problem... the script is integrated in our forums and works quite well. But if you're on a larger page where the script resized the outer frame and then click within the smaller frame a new link which forces the inner iframed page to load a smaller one - then it doesn't resize the outer one - it stays large. At least on Mac Safari & Firefox & Opera. Win IE works well...

Example:
1) Go to our board: http://www.arindal.com/html/de/community_board.html
2) Choose a larger thread with lot's of postings
3) Click on "Usergroups" for example - a page which contains only small content.

On my mac the outer design isn't resized.

Any ideas? Very Happy
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Tue Aug 22, 2006 7:11 pm    Post subject: Reply with quote

It works quite well for me on Windows with IE6 and Firefox 1.5, but I can see the problem using Opera 9.

hmm... maybe the problem now is similar to this one?
http://forums.phpmix.org/viewtopic.php?p=3357#3357

That fix was only for Opera. To try the same here, well, I think we could simply do that step using setTimeout for all browsers. So the fix would simply be as

FIND:
Code:
      // Resize the IFrame container.
      var dim = this.getDim(iframe.document);
      div.style.height = (dim[1]+30) + 'px';

REPLACE WITH:
Code:
      // Resize the IFrame container.
      // Use a slight delay, so getDim can get the correct dimensions.
      setTimeout('var dim = DYNIFS.getDim(window.frames[\''+id+'\'].document); document.getElementById(\''+id+'\').style.height = (dim[1]+30) + \'px\';', 1);

Again, the number 1 (close to the end of the statement) means 1 millisecond. You may want to play with different values.

Question Smile

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Tue Aug 22, 2006 10:01 pm    Post subject: Reply with quote

Mhh, as you already hinted me in this thread, I've got kinda loading delay within the iframe call:

Code:
onload="setTimeout('DYNIFS.resize(\'arindalboard\');', 150)"

instead of

Code:
onload="DYNIFS.resize('arindalboard')"


as it'd be like within your basic release. When I replace in dynifs.js your last code, I'll get an error in Win IE and nothing is resized anymore: Fehler "DYNIFS" ist undefiniert". Even when I replace the modified code by you above with ther orginal one, doesn't work.

I changed the files a bit to work with them:

http://www.arindal.com/html/de/community_board-test.html

and the js file:

http://www.arindal.com/html/de/dynifs-test.js

Unfortunately I'm no JS guru - hard for me to solve that but you do here absolutely great work! Really appreciated! Very Happy
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Tue Aug 22, 2006 10:14 pm    Post subject: Reply with quote

javascript error? hmm... maybe an unterminatted string?

Try copy/paste the code above (the REPLACE WITH part) again. There should be 3 lines, 2 of which are comments. The third line goes from setTimeout(' to 1);

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Tue Aug 22, 2006 10:22 pm    Post subject: Reply with quote

O.K. fixed that *sigh* - but the problem is still there, it doesn't resize when loading a link to a page with smaller content. With and without the changed iframe code. Watch yourself... Sad 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Tue Aug 22, 2006 10:35 pm    Post subject: Reply with quote

hmm... keeping the above change, please, try this:

FIND:
Code:
if( document.all ) div.style.height = '0px';

REPLACE WITH:
Code:
div.style.height = '0px';

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Eldritch
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 19

PostPosted: Tue Aug 22, 2006 10:40 pm    Post subject: Reply with quote

Looks great in Safari now. I'll check out Opera & stuff tomorrow with the guy who reported the error! Yay!

I see a more noticeable reload - blink now, guess the last change caused that, but's that doesn't matter if it works now!

Razz

Now I can sleep well Wink
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Tue Aug 22, 2006 10:51 pm    Post subject: Reply with quote

Great! Smile

You may want to reset the milliseconds value to 1, in the last change (I believe you've tried with 150 in your test script). ...or just play with different numbers until the balance is ok. The higher the number, the higher the blink Wink

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> Widgets Discussion -> Javascript Snippets All times are GMT + 1 Hour
Goto page Previous  1, 2, 3  Next
Page 2 of 3


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum