Skip to main content
Level 3
Oct 29, 2015 1:47 PM UTC
Solved

Anyone implemented/used Mobile Device Screen Orientation plugin?

Hi,

Has anyone successfully implemented screen orientation plugin in Sitecatalyst to capture mobile device orientation?. When we use the below code in the s_code,  in the web page i am seeing some unusual behavior(ie: when we scroll the page to the bottom and then if i click anywhere on the content section, page goes to the top by default). I understand, that's happening because of this line "window.scroll(0,0)". Any help or thoughts?

Plugin Code below:function screenOrientation(){switch(window.orientation){case 0:case 180:return("Portrait");break;case 90:case -90:return("Landscape");}window.scroll(0,0)}

Reference: http://webanalyticsland.com/sitecatalyst-implementation/capture-mobile-device-screen-orientation-in-sitecatalyst

Thanks in Advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
m_1985Accepted solution
Level 3
Nov 9, 2015 2:45 PM UTC

Hi Gigazelle,

Thanks for the reply. It works fine if we remove that line.

2 replies

Gigazelle
Adobe Employee
Adobe Employee
Nov 6, 2015 12:20 AM UTC

I struggle to see the value of the window.scroll function in context of the plugin. What happens if you remove that line?

Translate
m_1985AuthorAccepted solution
Level 3
Nov 9, 2015 2:45 PM UTC

Hi Gigazelle,

Thanks for the reply. It works fine if we remove that line.

Translate