Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Splitting on several lines
Message
From
01/06/2013 13:24:20
 
 
To
01/06/2013 13:20:40
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01575403
Message ID:
01575405
Views:
41
>I use this general style:
>
>If it's a single ternary:
>
largest = ((a > b) ? a : b);
>
>
>If it's a multi-clause ternary (such as your example), I always:
>
>(1) Put parenthesis around the test clause
>(2) Indent each true and false clause within
>
>
return (typeof loWindow.pageYOffset != 'undefined') ?
>        loWindow.pageYOffset :
>        (document.documentElement.scrollTop) ?
>            (document.documentElement.scrollTop) : 
>            (document.body.scrollTop) ? 
>                document.body.scrollTop :
>                0
Thanks, but I meant something more readable. So far, I have this but this is not working:
   function PositionTop()
   {
      lnOffset=0
      loWindow=window.parent.oParent
      if (typeof loWindow.pageYOffset != 'undefined')
      {
         lnOffset=loWindow.document.documentElement.scrollTop
      }
      else
      {
         lnOffset=loWindow.document.body.scrollTop
      }
   }
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform