Page shifting

Page: 1

Author Post
Member
Registered: Apr 2009
Posts: 30
Great tool!

I just downloaded the latest version and it seems to be giving me a hard time.

I am using XAJAX and a hidden div with a call to loadanchor. Life is good until the floatbox is closed.

At that point my page content has been shifted up to the top of the window and no amount of cohersion will restore it.

Ideas?

Thanks,
Ed
Administrator
Registered: Aug 2008
Posts: 3382
No idea. Got a link where I can peer into this behaviour a little closer?

I don't think there's anything in floatbox that can shift your page on close (but I've been wrong before).

Can you work around it by setting an afterBoxEnd action with a scrollTo() command to put the page where you want it? Or perhaps a named anchor or id on the page and a loadPageOnClose setting using that #name?
Member
Registered: Apr 2009
Posts: 30
Thanks for the quick reply.

Cant supply a link as it is all in development.

I'll try scrollTo() but I don't hold much hope...
Member
Registered: Apr 2009
Posts: 30
loadPageOnClose:self works but itseems a bit of a hack... :|

Ed
Administrator
Registered: Aug 2008
Posts: 3382
Agreed. But without a page to look at, it's the best I can come up with for you. I've never seen this behaviour nor heard of anyone else experiencing it.
Member
Registered: Apr 2009
Posts: 30
Another insight: It only seems to happen with IE. FF wirks file...
Administrator
Registered: Aug 2008
Posts: 3382
Any chance the link that invokes loadAnchor has an href of "#" and does not have "return false;" after onclick's loadAnchor call?
Member
Registered: Apr 2009
Posts: 30
The loadAnchor call is made by scripting from a php page using XAJAX.

Here's the code:

$resp->assign("fbdiv","innerHTML", $s); //populate the hidden div
$resp->script('fb.loadAnchor("#fbdiv", rev="width:900 height:500 scrolling:auto loadPageOnClose:self",
title="Account Details - Press Esc or Click Close to Return" )'); //Script the loadanchor call
return $resp; //Send it to the browser
Administrator
Registered: Aug 2008
Posts: 3382
I doubt this causes your scroll problem, but your loadAnchor call as quoted is whack. The parameters are just strings, so the "rev=" and "title=" portion of the 2nd and 3rd parameters needs to go. I'm surprised it would even work as quoted.
Member
Registered: Apr 2009
Posts: 30
The loadAnchor call is a parameter to the script() function. It has single quotes around it and double quotes within. The script() function causes the passed string to be executed as JS when it reaches the browser.

Works great :D
Administrator
Registered: Aug 2008
Posts: 3382
No no. You misunderstand me.
fb.loadAnchor("#fbdiv", rev="width:900 height:500 scrolling:auto loadPageOnClose:self", title="Account Details - Press Esc or Click Close to Return" )

...should be...
fb.loadAnchor("#fbdiv", "width:900 height:500 scrolling:auto loadPageOnClose:self", "Account Details - Press Esc or Click Close to Return" )


I can see how it would work fine though. In your mistaken syntax, you are assigning a string to the global var rev and to the global var title and returning the results of those assignments as parameters to loadAnchor. What you mean to do is to just pass the strings, so for cleanliness' sake, delete the rev= and title= bits.
Member
Registered: Apr 2009
Posts: 30
Did that. Works fine but the problem still exists.

I have a lot of CSS of my own in the pages. perhaps it's one of those.
Member
Registered: Apr 2009
Posts: 30
Well I found it....


//floatbox.js line 168 was
t.ieOld = parseInt(version.substr(version.indexOf(&#039;MSIE&#039;) + 5), 10) < 7;
//Changed it to
t.ieOld = parseInt(version.substr(version.indexOf(&#039;MSIE&#039;) + 5), 10) < 6;


Now all is well with the world!

Thanks for your help and a very nice tool.

Ed
Administrator
Registered: Aug 2008
Posts: 3382
Oh no. You don't want to do that. In floatbox, ieOld is defined as version 6 or earlier. The change you made will cause floatbox to not recognize IE6 as old, and will not run the code needed to make it behave. Your IE6 site visitors will get bad rendering of shadows, will try to load round corners and mess up the box layout, the semi-opaque overlay will not grow with a browser window resize, any select elements on the base page will bleed through floatbox, might get weird jpg fade in/out artifacts, and will probably get some bad control positioning if you move the controls around.

But your experiment could help narrow down the problem. Now I assume when you say it happens only in IE, that you are testing with IE6. And if that change got rid of the scroll problem, then it must be something in the IE6-specific helper code. Damn I wish you could provide a link instead of this endless conjecturing with the lights out.
Member
Registered: Apr 2009
Posts: 30
!@#$%. I changed it back to 7 and the problem went away.

Arrrrrrgh :evil:
Administrator
Registered: Aug 2008
Posts: 3382
Well, that's good, right? :D
Member
Registered: Apr 2009
Posts: 30
That's good :D

I think it might be a cache issue. I'll tryit tomorrow and let you know.

Ed
Member
Registered: Apr 2009
Posts: 30
Couldn't reproduce the problem.

Write it off to bad carma.

Have another issue at the moment:

I use FB to display help pages. The pages contain html/plain text and get loaded into a hidden div tag and are displayed using loadAnchor(). The problem is that they are all displaying the content centered in the FB window.

If I unhide the hidden div, the text is aligned normally.

Any thoughts?

Ed
Administrator
Registered: Aug 2008
Posts: 3382
Oh man, you're trying to get me to go down another rabbit hole of guessing what might be going on without seeing anything. Are you sure you can't post an unlinked sample up on your web server somewhere that I can look at? Are you really really sure you can't do that?

I would think that the only reason why your text might be centered is that something told it to be centered. You could take a look in firebug after the floatbox with the centered content is open, navigate through the html in firebug to find your content, and then check out the styles in effect for that content. That should tell you where the centering is coming from.

Page: 1