Announcement

Collapse
No announcement yet.

Can Scriptcase Menus behave themselves??!!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can Scriptcase Menus behave themselves??!!

    I've played around with horizontal menus and notice these you can only left or right justify or centre the items on the line; this does not look modern compared with contemporary apps especially when the items are few. When the items are more, it wraps unto the next line.

    Has anyone discovered a hack to make the menu items take up 100% of the available screen width (i.e. resize each item equally but not enlarge the text)

  • #2
    You should be able to do something like this: http://www.scriptcase.net/forum/show...he-entire-page
    However I'm not really a CSS god so don't ask me how.

    Comment


    • #3
      Originally posted by hoihoi661 View Post
      You should be able to do something like this: http://www.scriptcase.net/forum/show...he-entire-page
      However I'm not really a CSS god so don't ask me how.
      Yeah I'd seen this but it has no effect on the menu.

      Comment


      • #4
        How do you mean no effect on the menu?
        It's CSS if you want to you can make it have effect on everything, just use !important.
        You'd have to put the echo on one of the menu's events btw, not an application called by the menu in case that's the problem.

        Comment


        • #5
          Originally posted by scriptcaser View Post
          Yeah I'd seen this but it has no effect on the menu.
          I think could be interesting if you share an screenshot about exactly what you mean, and what you want. As Matt sais, is more related to CSS.
          /Giuseppe

          Professional Scriptcase Services
          Some Customers opinions

          Comment


          • #6
            Originally posted by Giu View Post
            I think could be interesting if you share an screenshot about exactly what you mean, and what you want. As Matt sais, is more related to CSS.
            Attached shot shows what I want. Don't know CSS enough but I can follow any pointers. I don't think the code referred to in the link addresses menu apps nor the menu bar specifically.
            Attached Files

            Comment


            • #7
              Hi there...

              you can do this but you have to use jscript.. i believe you can do something like

              PHP Code:

              var myElements document.querySelectorAll(".topmenu toproot");
               
              var 
              h=window.height()/<number of elements in your menu>;
              for (var 
              0myElements.lengthi++) {
                  
              myElements[i].style.width h;

              You should customize this code this is just an example, in this case im selecting the css class "topmenu toproot" of the document, you have to set the right one for your menu.

              Hope this is of help.

              Regards

              oh i forgot you can also use CSS straight, like an

              echo 'style bla bla'

              you just have to set the width of the class to a % , for example if you have 10 elements set the width to a 10% =P

              some more regards >.<
              Last edited by kafecadm; 03-18-2015, 01:47 PM.

              Comment


              • #8
                Originally posted by kafecadm View Post
                Hi there...

                you can do this but you have to use jscript.. i believe you can do something like

                PHP Code:

                var myElements document.querySelectorAll(".topmenu toproot");
                 
                var 
                h=window.height()/<number of elements in your menu>;
                for (var 
                0myElements.lengthi++) {
                    
                myElements[i].style.width h;

                You should customize this code this is just an example, in this case im selecting the css class "topmenu toproot" of the document, you have to set the right one for your menu.

                Hope this is of help.

                Regards

                oh i forgot you can also use CSS straight, like an

                echo 'style bla bla'

                you just have to set the width of the class to a % , for example if you have 10 elements set the width to a 10% =P

                some more regards >.<
                Ok so:

                ==> the CSS option is static whilst the javascript is dynamic?

                ==> in the jscript code above, you meant var h=window.width()/<number... right?

                ==> if using the jscript, how would this go in? echo statement as well? what would make it execute before the menu is rendered by the browser?

                Comment


                • #9
                  actually you should have to use the sc_java suttuff to execute it, in the cas of the static CSS you simply echo it in the onexecute event.

                  Regards.

                  Comment


                  • #10
                    How did it go?

                    Comment


                    • #11
                      Originally posted by kafecadm View Post
                      How did it go?
                      haven't had the $%^"! to try it yet but will do so tomorrow and let you know.

                      Comment


                      • #12
                        ok good luck.

                        Comment


                        • #13
                          Kafecadm,

                          Thanks for asking. Please see the screenshot: the code seems to have no effect. Inspecting elements though, is ".topmenu toproot" the appropriate selector?
                          Attached Files

                          Comment


                          • #14
                            By the way, when I view the source of the generated page, this piece of code does not show up at all so I guess page gen is concluded prior to the event. Also it fails if put in onApplicationInit (the raw code is simply echoed to screen).

                            Comment


                            • #15
                              Spoke too soon: the code becomes part of the page if echoed in onApplicationInit. Still does not work though: menu looks the same. My best guess would be because this code is not part of the document.ready function of JS. Please see attached. Any ideas?
                              Attached Files

                              Comment

                              Working...
                              X