Jump to content

Wylbur

Members
  • Posts

    25
  • Joined

  • Last visited

Posts posted by Wylbur

  1. Hi,

    I suppose that you know that Angular version 2 is out?

    Is a new section being created for it?

    If so, when would it be ready to go online?

    Have you looked at "Aurelia"?

    http://aurelia.io/

    Are there any plans to add a section for that?

    Inquiring minds want to know.

     

  2. The max-height as it suggest sets the highest height the element can have, so its height can extend from 0 a empty element, and as content increases within it to the max height set and not beyond that set max height, then after that you could set it to have a scroll bar to right using overflow: auto; or overflow-y: auto;

     

    Hi Dsones

     

    OK - now I see.

     

    From what I can determine, it looks as if height and min-height will override each other, using whichever is the largest.

     

    In furtherance of my experiment, I switched to span, with display : block. It doesn't look like there is any difference from div.

     

    Please correct me if I am wrong.

     

    I've also switched to 'em' for size specifications.

    From all of this, I don't see the point of the example that I referenced within my original post, and what it is intended to demonstrate:

    http://www.w3schools..._dim_max-height

    This is the state of my code at this point:

    <!DOCTYPE html>
    <html>
    <head>
    
    <style>
    
    .group:after {
      content: "";
      display: table;
      clear: both;
    }
    
    .container_tag
    {
        min-height : 28em;
        height : 24em;
        max-height : 38em;
    
        min-width : 30em;
        max-width : 57em;
    
        background-color: lightgreen;
        foreground-color: black;
        margin : 20px;
        border : solid;
    
        clear : both;
        display : block;
    }
    </style>
    </head>
    <body>
    
    <span class='container_tag group'>
    
    <h2>Set the max-width of an element</h2>
    <p>This div element has a height of 100px and a max-width of 500px:</p>
    
    :::------------------------------------this is some text : 1------------------------------:::<br/>
    :::------------------------------------this is some text : 2------------------------------:::<br/>
    :::------------------------------------this is some text : 3------------------------------:::<br/>
    :::------------------------------------this is some text : 4------------------------------:::<br/>
    :::------------------------------------this is some text : 5------------------------------:::<br/>
    :::------------------------------------this is some text : 6------------------------------:::<br/>
    :::------------------------------------this is some text : 7------------------------------:::<br/>
    
    </span>
    </body>
    </html>
    
    

    If there is nothing more to investigate, then I'll leave it at that.

     

     

    THANK YOU for your responses!

  3. The outer div height will never extend more than the max-height of inner div + 20px margin, remember the div height is determined by child element content, the inner div stops extending its height 280px, so its content area can't extend any further, but its content will seep out below it, but this has no effect on the outer container height.

     

    Hi Dsones,

     

    THANKS for the response!

     

    I took out the inner div. The outer (only) div still does not resize vertically when I shorten the window/browser.

     

    The only thing that will increase the height of the div is to increase the value of min-height, as changing max-height

    doesn't seem to have any effect.

     

    Am I correct in stating that max-height doesn't do anything to div?

     

    What effect (purpose) does max-height have?

  4. The content may not be enough to extend the container element height between 200px and 600px.

     

    Hi D Sones

     

    Thanks for the response.

     

    I've been experimenting with this, and I cannot get the height to behave in the same way as the width

    when I reduce the size of the window/browser. (The modified code is inserted below. I now have two

    "div" tags, with one nested inside the other.)

     

    To be more explicit: When I reduce the width of the window/browser, the boxes for the "div" tags narrow as well,

    to the point that the min-width is reached (which is expected). When I reduce the height of the window/browser,

    the height of the boxes do not change at all.

     

    How would I get the same behavior for height as I do with width?

    
    <!DOCTYPE html>
    <html>
    <head>
    
    <style>
    
    .outer_div
    {
        /* height : 400px; */
        min-height : 400px;
        max-height : 700px;
    
        min-width : 300px;
        max-width : 900px;
        margin : 20px;
        border : solid;
    }
    
    .inner_div {
        /* height: 220px; */
        min-height: 220px;
        max-height: 280px;
    
        min-width: 400px;
        max-width: 700px;
        background-color: powderblue;
        foreground-color: black;
        border : solid;
        margin : 20px;
        /* clear : both; */
    }
    
    
    </style>
    </head>
    
    <body>
    
    <div class='outer_div'>
    <h2>Set the max-width of an element</h2>
    <p>This div element has a height of 100px and a max-width of 500px:</p>
    
    <div class='inner_div'>
    :::------------------------------------this is some text : 1------------------------------:::<br/>
    :::------------------------------------this is some text : 2------------------------------:::<br/>
    :::------------------------------------this is some text : 3------------------------------:::<br/>
    :::------------------------------------this is some text : 4------------------------------:::<br/>
    :::------------------------------------this is some text : 5------------------------------:::<br/>
    :::------------------------------------this is some text : 6------------------------------:::<br/>
    :::------------------------------------this is some text : 7------------------------------:::<br/>
    
    </div>
    
    </div>
    </body>
    </html>
    
    

    Thanks!

  5. Hi All;

     

    The height element does not seem to be working as expected for the following example:

     

    http://www.w3schools.com/css/tryit.asp?filename=trycss_dim_max-height

     

    When I resize the window/browser, the div element does not change in height.

     

    I made a few changes to the code, adding a "border" to show the box better:

    
    <!DOCTYPE html>
    <html>
    <head>
    <style>
    div {
        max-height: 600px;
        min-height: 200px;
        background-color: powderblue;
        border : solid;
    }
    </style>
    </head>
    <body>
    
    
    <h2>Set the max-height and min-height of an element</h2>
    <p>Resize the browser window to see the effect.</p>
    
    
    <div>This is some text. This is some text. This is some text.
    This is some text. This is some text. This is some text.
    This is some text. This is some text. This is some text.</div>
    
    
    </body>
    </html>
    
    Any ideas as to what the issue is?
    ... or am I missing something here?
    Thanks!
  6. Basically, if I could determine when the back and forward buttons were clicked

    (with Javascript) I'd probably have what I need to resolve my issue. It would be

    nice if there were "onbackbutton" and "onforwardbutton" event handlers, but

    I've yet to find anything that would fill those roles. I'm hoping that someone might

    give me a clue on something that I've overlooked.

     

    I see that there's a "window.onpopstate" event, but it doesn't seem to be

    doing anything for me as of yet. I'm going to keep playing with it.

  7.  

    Hi Dave;

     

    I've seen those.

     

    The first one applies to server-side functionality.

     

    The problem is that, when the back button is pressed,

    it does not trigger a postback event, so whatever server-side

    code there is won't be executed.

     

    The second one looked good at first, but it only applies to

    AJAX/Updatepanel/asynchronous postbacks. It threw an exception when

    I tried it on a just plain synchronous postback.

     

    THANKS for the response!

  8. Hi;I'm developing a web app in ASP.NET that loads controlsdynamically on a page (depending upon user responses).Handling the back button has been giving me fits.Apparently, there is no handler for that.(If I'm wrong about that, then PLEASE correct me.)What I want to do is to trigger a postback on the back button.(This must be done. There are no alternatives.)I'm trying to detect the "back button state" to accomplish this.The first thing I tried was to keep a running count ofrequest/response cycles and comparing it to window.history.length.If the two are different, then it might be assumed that the backbutton had been clicked.That didn't work. On the first back button click, both countsincreased, remaining equal.My next idea was to write Javascript code to a label that willset a boolean to true if a postback has occurred.In my Page_Load handler, I have the following: this.lblJavaScript.EnableViewState = false; this.lblJavaScript.InnerText = "postback_made = true;";This is the tag for the element: <span class="CI12_test" id="lblJavaScript" name="lblJavaScript" runat="server"></span>(This tag is positioned above the form and within the body.)In the function that handles the onload event in Javascript,I have the following: var js_code = document.getElementById("lblJavaScript").innerHTML; var ev = window.eval (js_code); document.getElementById("lblJavaScript").innerHTML = "postback_made = false;"The problem that I'm having is that, when the back button is clicked,the "lblJavaScript" element is reset to its original value("postback_made = true;"). I tried moving the code for clearing the switch into a function thathandles the "onbeforeunload(e)" event.That didn't work.(FYI: The "onbeforeunload" event fires every time, whether on a postbackor back button click.)Apparently, the values for the elements within the DOM are being cachedand reloaded on a back button event.Since I'm not quite the biggest idiot in the world, I decided that thenext thing to do would be to shut off caching. I added the following code to my Page_Load event handler: if (!IsPostBack) { Response.Buffer = true; Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1441; }That does nothing.I added the following code to my Page_Load event handler:Response.Cache.SetCacheability(HttpCacheability.NoCache);Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));Response.Cache.SetNoStore();When I clicked on the back button, I was left with "Webpage has expired".I added the following meta tags near the top of the page:<meta http-equiv="Cache-Control" content="no-cache"/><meta http-equiv="Pragma" content="no-cache"/><meta http-equiv="Expires" content="0"/>That did nothing.So the question is: How would someone determine if the page beingloaded is due to a postback or a back button click?Alternatively, how would someone force a postback on a back button click?Any advice on this would be greatly appreciated.

×
×
  • Create New...