HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


The "body" snatcher "Join" iFrame

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#92491 (In Topic #18544)
Avatar

Community saint

on main_greeting Block

This is not a bug report, but rather an observation and a question as to why the main_greeting_block  "join" link uses an iFrame instead of linking directly to a page like the other joining links listed below?

This iFrame is snatching the 'body' background of the jquery parallax plugin I'm working on and getting spooked by the animation (unresponsive). I'm just wondering if there is a way around this. It is always possible to eliminate that block from the page, but I intend to share this theme as an addon when completed. I know this iFrame is not really the cause, but the result of the method used by this plugin. I originally had all the iFrames affected by this, but after  moving the script from HTML_HEAD.tpl to GLOBAL_HTML_WRAP.tpl this one seem to be the only one not cured.

A typical ocPortal page might have three "join" links available to visitors (guests).

The Welcome greeting (main_greeting block)

The Login box / personal stats (side_personal_stats block)

footer .global_minilinks .horizontal_links


The main_greeting block seem to be the only one with an iframe.

Thanks,
Jean
Back to the top
 
Posted
Rating:
#92492
Avatar

I don't think there's any iframe involved :S.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#92511
Avatar

Community saint

Chris Graham said

I don't think there's any iframe involved .

​Chris,
This is from the main_greeting block. The other 'joins' on the page do not behave in the same way.

You can verify this HERE if you want.



Jean
Back to the top
 
Posted
Rating:
#92514
Avatar

Oh of course, the overlay. I thought you meant the block was in an iframe, or it loaded a new page that contained one.

You'll notice the body class of the overlay has the 'overlay' CSS class, so that can be used to target changes. Or perhaps better, target changes onto #main_website, which only the main site uses.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#92519
Avatar

Community saint

Chris Graham said

Oh of course, the overlay. I thought you meant the block was in an iframe, or it loaded a new page that contained one.

You'll notice the body class of the overlay has the 'overlay' CSS class, so that can be used to target changes. Or perhaps better, target changes onto #main_website, which only the main site uses.


Thanks for your reply Chris, but I don't know what to do with your suggestion: target changes onto #main_website .  
Here is my understanding:
From GLOBAL_HTML_WRAP.tpl, my Parallax Runtime script function is calling 3 images directly into the "main_website" body class.
The 'join' iframe overlay is picking up the entire animation sequence instead of the normal box background image.

I've also noticed that if you "open the 'join' link in a new tab" it works without problem.

Jean
Back to the top
 
Posted
Rating:
#92521
Avatar

1) There's an "Enable Javascript overlays" option you can instruct people to disable.

2) You can remove onclick="return open_link_as_overlay(this);" from the JOIN_OR_LOGIN template.

3) if (!window.parent) { ... } could be placed around your JS code that attached the images, to check that it is not in a frame.

I'd suggest doing all 3 :).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#92525
Avatar

Community saint

Chris Graham said

1) There's an "Enable Javascript overlays" option you can instruct people to disable.

2) You can remove onclick="return open_link_as_overlay(this);" from the JOIN_OR_LOGIN template.

3) if (!window.parent) { … } could be placed around your JS code that attached the images, to check that it is not in a frame.

I'd suggest doing all 3 .


Thanks for the suggestions:

3)Unfortunately, this disables the jQuery animation.
2)Looks like the best option, since the main_greeting block seems to be the only 'Join/login' combo that behaves badly under this javascript.
1)This did the trick, but if using option 2, the "Javascript overlays" option can be left to the default enabled, keeping things easier for most people wanting to use this theme.

once again, your help was very much appreciated, Chris!:thumbs:

This Theme will shortly be shared as an addon. I have another one in the works, which uses a different animation method with div and css class selectors causing no disturbances with the overlays.;)

Jean:)
Back to the top
 
Posted
Rating:
#92526
Avatar

3– Actually I should have said if (window.parent!=window) { ... }

The thing about 1/2, is that there there are lots of overlays in v9. E.g. the monitor buttons.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#92530
Avatar

Community saint

Chris Graham said

3– Actually I should have said if (window.parent!=window) { … }

The thing about 1/2, is that there there are lots of overlays in v9. E.g. the monitor buttons.


Still can't make #3 work.

I went looking for those overlays and saw what you mean about the 1/2 combo effectiveness.

I've now implemented both #1 and #2 as you suggested and everything seems to be fine now!

I don't quite understand what #3 would bring extra to the equation, but I'll have a look at javascript notes on this option when I have a chance.

Cheers!
Jean:)
Back to the top
 
Posted
Rating:
#92531
Avatar

#3 should have been if (window.parent==window) { ... } actually. That will tell it to only run from a window that is its own parent. I know it sounds bizarre, that's why its confusing me. But a frame's parent is the parent frame, and a normal window's parent is the window itself.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#92534
Avatar

Community saint

Chris Graham said

#3 should have been if (window.parent==window) { … } actually. That will tell it to only run from a window that is its own parent. I know it sounds bizarre, that's why its confusing me. But a frame's parent is the parent frame, and a normal window's parent is the window itself.


Chris,

I think, if I understand this, that in this case the jquery actually runs from a frame's parent and was therefore affecting all overlays using the same frame parent. The real normal window's parent only has the css dark green background (no images), and that's exactly what I get if I implement this option; no more parallax animation, just my scrolling .global_middle sitting on the main_website green background!:(

Jean
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: